mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
Wait for test cleanup. (#280)
Motivation: The current test function does not wait for the futures from close to return, and so they may in principle be leaked. This obscures errors that the test might hit with precondition failures. Modifications: Changed the defer statements to wait for the futures. Result: Fewer spurious test failures.
This commit is contained in:
1 parent
851dad09af
commit
85b835863f
1 file changed
+2
-2
@@ -653,7 +653,7 @@ class EchoServerClientTest : XCTestCase {
|
||||
}.bind(host: "127.0.0.1", port: 0).wait()
|
||||
|
||||
defer {
|
||||
_ = serverChannel.close()
|
||||
XCTAssertNoThrow(try serverChannel.syncCloseAcceptingAlreadyClosed())
|
||||
}
|
||||
|
||||
let clientChannel = try ClientBootstrap(group: group)
|
||||
@@ -666,7 +666,7 @@ class EchoServerClientTest : XCTestCase {
|
||||
}
|
||||
}.connect(to: serverChannel.localAddress!).wait()
|
||||
defer {
|
||||
_ = clientChannel.close()
|
||||
XCTAssertNoThrow(try clientChannel.syncCloseAcceptingAlreadyClosed())
|
||||
}
|
||||
dpGroup.wait()
|
||||
|
||||
|
||||
Reference in new issue
Block a user