Skip to content

Commit

Permalink
fix after pulling upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
rebello95 committed Sep 12, 2023
1 parent 1dfae04 commit ba97c49
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,18 @@ final class CallbackConformance: XCTestCase {
proto.domain = "connect-crosstest"
}
let expectation = self.expectation(description: "Stream completes")
var responseCount = 0
let responseCount = Locked(0)
let sizes = [31_415, 9, 2_653, 58_979]
let stream = client.failStreamingOutputCall { result in
switch result {
case .headers:
break

case .message(let output):
XCTAssertEqual(output.payload.body.count, sizes[responseCount])
responseCount += 1
responseCount.perform { responseCount in
XCTAssertEqual(output.payload.body.count, sizes[responseCount])
responseCount += 1
}

case .complete(_, let error, _):
guard let connectError = error as? ConnectError else {
Expand All @@ -468,7 +470,7 @@ final class CallbackConformance: XCTestCase {
})

XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed)
XCTAssertEqual(responseCount, 4)
XCTAssertEqual(responseCount.value, 4)
}
}

Expand All @@ -480,9 +482,9 @@ final class CallbackConformance: XCTestCase {
let cancelable = client.emptyCall(
request: SwiftProtobuf.Google_Protobuf_Empty()
) { response in
XCTAssertEqual(response.code, .canceled)
XCTAssertEqual(response.error?.code, .canceled)
expectation.fulfill()
XCTAssertEqual(response.code, .canceled)
XCTAssertEqual(response.error?.code, .canceled)
expectation.fulfill()
}
cancelable.cancel()
XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed)
Expand Down

0 comments on commit ba97c49

Please sign in to comment.