Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests to work with unreleased swift-nio changes #2001

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading