diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index d858d0dcfd28..2c7598bb6c3f 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -3602,10 +3602,11 @@ public async Task RST_STREAM_IncompleteRequest_AdditionalWindowUpdateFrame_Conne await SendDataAsync(1, new byte[1], endStream: false); await SendRstStreamAsync(1); await SendWindowUpdateAsync(1, 1024); - tcs.TrySetResult(); await WaitForConnectionErrorAsync(ignoreNonGoAwayFrames: false, expectedLastStreamId: 1, Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.WINDOW_UPDATE, 1)); + + tcs.TrySetResult(); // Don't let the response start until after the abort } [Fact]