Skip to content

Commit ae52491

Browse files
committed
test less flaky
1 parent 62b7fcc commit ae52491

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Sources/AsyncHTTPClient/ConnectionPool/HTTP2/HTTP2Connection.swift

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ final class HTTP2Connection {
8080
private var openStreams = Set<ChannelBox>()
8181
let id: HTTPConnectionPool.Connection.ID
8282

83+
var closeFuture: EventLoopFuture<Void> {
84+
self.channel.closeFuture
85+
}
86+
8387
init(channel: Channel,
8488
connectionID: HTTPConnectionPool.Connection.ID,
8589
delegate: HTTP2ConnectionDelegate,

Tests/AsyncHTTPClientTests/HTTP2ConnectionTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class HTTP2ConnectionTests: XCTestCase {
215215
}
216216
}
217217

218-
XCTAssertFalse(http2Connection.channel.isActive)
218+
XCTAssertNoThrow(try http2Connection.closeFuture.wait())
219219
}
220220
}
221221

0 commit comments

Comments
 (0)