Skip to content

Commit

Permalink
Workaround grpc#43 in tests
Browse files Browse the repository at this point in the history
Motivation:

A couple of tests fail sometimes, the root cause of which is grpc#43.

Modifications:

- Wait for all messages to be received before closing

Result:

Tests are more stable
  • Loading branch information
glbrntt committed Dec 6, 2024
1 parent 2f2d250 commit 9c34ce6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/GRPCNIOTransportHTTP2Tests/HTTP2TransportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,8 @@ final class HTTP2TransportTests: XCTestCase {
let request = ClientRequest(message: input)
try await control.serverStream(request: request) { response in
XCTAssertEqual(Array(response.metadata["echo-scheme"]), ["http"])
// Workaround https://github.com/grpc/grpc-swift-nio-transport/issues/43
for try await _ in response.messages {}
}
}
}
Expand Down Expand Up @@ -1430,6 +1432,8 @@ final class HTTP2TransportTests: XCTestCase {
}
try await control.bidiStream(request: request) { response in
XCTAssertEqual(Array(response.metadata["echo-scheme"]), ["http"])
// Workaround https://github.com/grpc/grpc-swift-nio-transport/issues/43
for try await _ in response.messages {}
}
}
}
Expand Down

0 comments on commit 9c34ce6

Please sign in to comment.