Skip to content

Commit 6c0bc45

Browse files
authored
Workaround #43 in tests (#44)
Motivation: A couple of tests fail sometimes, the root cause of which is #43. Modifications: - Wait for all messages to be received before closing Result: Tests are more stable
1 parent 2f2d250 commit 6c0bc45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/GRPCNIOTransportHTTP2Tests/HTTP2TransportTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,8 @@ final class HTTP2TransportTests: XCTestCase {
14001400
let request = ClientRequest(message: input)
14011401
try await control.serverStream(request: request) { response in
14021402
XCTAssertEqual(Array(response.metadata["echo-scheme"]), ["http"])
1403+
// Workaround https://github.com/grpc/grpc-swift-nio-transport/issues/43
1404+
for try await _ in response.messages {}
14031405
}
14041406
}
14051407
}
@@ -1430,6 +1432,8 @@ final class HTTP2TransportTests: XCTestCase {
14301432
}
14311433
try await control.bidiStream(request: request) { response in
14321434
XCTAssertEqual(Array(response.metadata["echo-scheme"]), ["http"])
1435+
// Workaround https://github.com/grpc/grpc-swift-nio-transport/issues/43
1436+
for try await _ in response.messages {}
14331437
}
14341438
}
14351439
}

0 commit comments

Comments
 (0)