Skip to content

Commit 81f9d13

Browse files
committed
Stabilize InvokeWithCancellationAsync_TimeoutAndDisconnectDuringSend_ThrowsTimeoutException test
1 parent ccc6653 commit 81f9d13

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/StreamJsonRpc/JsonRpc.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,6 +2341,10 @@ private JsonRpcError CreateCancellationResponse(JsonRpcRequest request)
23412341
{
23422342
throw new TimeoutException(Resources.FormatOutboundInvocationTimedOut(nameof(this.OutboundRequestTimeout)), ex);
23432343
}
2344+
catch (ConnectionLostException ex) when (timeoutCancellationSource?.IsCancellationRequested is true && !cancellationToken.IsCancellationRequested)
2345+
{
2346+
throw new TimeoutException(Resources.FormatOutboundInvocationTimedOut(nameof(this.OutboundRequestTimeout)), ex);
2347+
}
23442348
catch (OperationCanceledException ex) when (this.DisconnectedToken.IsCancellationRequested && !effectiveOutboundCancellationToken.IsCancellationRequested)
23452349
{
23462350
throw new ConnectionLostException(Resources.ConnectionDropped, ex);

0 commit comments

Comments
 (0)