Skip to content

Commit

Permalink
Fix tests to work with unreleased swift-nio changes
Browse files Browse the repository at this point in the history
  • Loading branch information
czechboy0 committed Aug 1, 2024
1 parent 44fa451 commit 885abab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Tests/GRPCTests/ConnectionManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,9 @@ extension ConnectionManagerTests {
let manager = self.makeConnectionManager(configuration: configuration) { _, _ in
self.loop.makeFailedFuture(DoomedChannelError())
}
defer {
try! manager.shutdown().wait()
}

self.waitForStateChanges([
Change(from: .idle, to: .connecting),
Expand Down Expand Up @@ -1154,9 +1157,7 @@ extension ConnectionManagerTests {

func testHTTP2Delegates() throws {
let channel = EmbeddedChannel(loop: self.loop)
defer {
XCTAssertNoThrow(try channel.finish())
}
// The channel gets shut down by the connection manager.

let multiplexer = HTTP2StreamMultiplexer(
mode: .client,
Expand Down Expand Up @@ -1215,6 +1216,11 @@ extension ConnectionManagerTests {
http2Delegate: http2,
logger: self.logger
)
defer {
let future = manager.shutdown()
self.loop.run()
try! future.wait()
}

// Start connecting.
let futureMultiplexer = manager.getHTTP2Multiplexer()
Expand Down

0 comments on commit 885abab

Please sign in to comment.