@@ -81,8 +81,8 @@ extension ServerTimeoutTests {
81
81
call. waitForSendOperationsToFinish ( )
82
82
83
83
do {
84
- _ = try call. closeAndReceive ( )
85
- XCTFail ( " should have thrown " )
84
+ let result = try call. closeAndReceive ( )
85
+ XCTFail ( " should have thrown, instead received \( result ) " )
86
86
} catch let receiveError {
87
87
XCTAssertEqual ( . unknown, ( receiveError as! RPCError ) . callResult!. statusCode)
88
88
}
@@ -97,7 +97,8 @@ extension ServerTimeoutTests {
97
97
completionHandlerExpectation. fulfill ( )
98
98
}
99
99
100
- // TODO(danielalm): Why doesn't `call.receive()` throw once the call times out?
100
+ // FIXME(danielalm): Why does `call.receive()` essentially return "end of stream" once the call times out,
101
+ // rather than returning an error?
101
102
XCTAssertNil ( try ! call. receive ( ) )
102
103
103
104
waitForExpectations ( timeout: defaultTimeout)
@@ -118,17 +119,9 @@ extension ServerTimeoutTests {
118
119
}
119
120
call. waitForSendOperationsToFinish ( )
120
121
121
- // FIXME(danielalm): Why does `call.receive()` only throw on Linux (but not macOS) once the call times out?
122
- #if os(Linux)
123
- do {
124
- _ = try call. receive ( )
125
- XCTFail ( " should have thrown " )
126
- } catch let receiveError {
127
- XCTAssertEqual ( . unknown, ( receiveError as! RPCError ) . callResult!. statusCode)
128
- }
129
- #else
122
+ // FIXME(danielalm): Why does `call.receive()` essentially return "end of stream" once the call times out,
123
+ // rather than returning an error?
130
124
XCTAssertNil ( try ! call. receive ( ) )
131
- #endif
132
125
133
126
waitForExpectations ( timeout: defaultTimeout)
134
127
}
0 commit comments