mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
Extend timeout in testShutdownCancelsOutstandingScheduledCallbacks (#3537)
Extend timeout in testShutdownCancelsOutstandingScheduledCallbacks ### Motivation: * `testShutdownCancelsOutstandingScheduledCallbacks` can be flaky, particularly on slower systems like simulated devices in CI. * In some circumstances the task can be executed before it has chance to be cancelled. ### Modifications: * Schedule the task for the far future so that it is available to be cancelled even on slower systems. ### Result: Less flaky tests.
This commit is contained in:
1 parent
acf9bbe0fd
commit
7ba045dc7d
1 file changed
+2
-2
@@ -183,7 +183,7 @@ final class IsolatedEventLoopScheduledCallbackTests: XCTestCase {
|
||||
func testShutdownCancelsOutstandingScheduledCallbacks() throws {
|
||||
let handler = NonSendableMockScheduledCallbackHandler()
|
||||
|
||||
_ = try self.loop.assumeIsolated().scheduleCallback(in: .milliseconds(1), handler: handler)
|
||||
_ = try self.loop.assumeIsolated().scheduleCallback(in: .hours(1), handler: handler)
|
||||
self.shutdownEventLoop()
|
||||
handler.assert(callbackCount: 0, cancelCount: 1)
|
||||
}
|
||||
@@ -336,7 +336,7 @@ extension _BaseScheduledCallbackTests {
|
||||
func testShutdownCancelsOutstandingScheduledCallbacks() async throws {
|
||||
let handler = MockScheduledCallbackHandler()
|
||||
|
||||
_ = try self.loop.scheduleCallback(in: .milliseconds(1), handler: handler)
|
||||
_ = try self.loop.scheduleCallback(in: .hours(1), handler: handler)
|
||||
try await self.shutdownEventLoop()
|
||||
handler.assert(callbackCount: 0, cancelCount: 1)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user