Skip to content

Commit 5753baf

Browse files
authored
Fix test to catch QUIC abort exception (#34298)
1 parent f74c6f1 commit 5753baf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Servers/Kestrel/Transport.Quic/test/QuicStreamContextTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,10 @@ public async Task ServerToClientUnidirectionalStream_ServerAborts_ClientGetsAbor
266266
((IProtocolErrorCodeFeature)serverStream).Error = (long)Http3ErrorCode.InternalError;
267267
serverStream.Abort(new ConnectionAbortedException("Test message"));
268268

269-
// TODO - client isn't getting abort?
270-
readCount = await clientStream.ReadAsync(buffer).DefaultTimeout();
269+
var ex = await Assert.ThrowsAsync<QuicStreamAbortedException>(() => clientStream.ReadAsync(buffer).AsTask()).DefaultTimeout();
271270

272271
// Assert
273-
Assert.Equal(0, readCount);
272+
Assert.Equal((long)Http3ErrorCode.InternalError, ex.ErrorCode);
274273

275274
var quicStreamContext = Assert.IsType<QuicStreamContext>(serverStream);
276275
Assert.True(quicStreamContext.CanWrite);

0 commit comments

Comments
 (0)