Skip to content

Commit 29d194f

Browse files
authored
Fix flaky test: testConnectionClosesAfterTheRequestWithoutHavingSentAnCloseHeader (#520)
1 parent a79206d commit 29d194f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/AsyncHTTPClientTests/HTTP1ConnectionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ class HTTP1ConnectionTests: XCTestCase {
320320
defer { XCTAssertNoThrow(try eventLoopGroup.syncShutdownGracefully()) }
321321

322322
let httpBin = HTTPBin(handlerFactory: { _ in AfterRequestCloseConnectionChannelHandler() })
323+
defer { XCTAssertNoThrow(try httpBin.shutdown()) }
323324

324325
var maybeChannel: Channel?
325326

@@ -362,7 +363,6 @@ class HTTP1ConnectionTests: XCTestCase {
362363

363364
XCTAssertNoThrow(try XCTUnwrap(maybeChannel).closeFuture.wait())
364365
XCTAssertEqual(connectionDelegate.hitConnectionClosed, 1)
365-
XCTAssertEqual(httpBin.activeConnections, 0)
366366
}
367367

368368
func testConnectionIsClosedAfterSwitchingProtocols() {

0 commit comments

Comments
 (0)