From d476349595551b9b9527d33d90796d12c1464268 Mon Sep 17 00:00:00 2001 From: Chris R Date: Fri, 19 Mar 2021 10:26:58 -0700 Subject: [PATCH] Fix race in FrameAfterTrailers_UnexpectedFrameError #30754 --- .../test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs index a7fce40ae41f..580a41392b53 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs @@ -1685,6 +1685,10 @@ public async Task FrameAfterTrailers_UnexpectedFrameError() var requestStream = await InitializeConnectionAndStreamsAsync(_noopApplication); await requestStream.SendHeadersAsync(headers, endStream: false); + + // The app no-ops quickly. Wait for it here so it's not a race with the error response. + await requestStream.ExpectHeadersAsync(); + await requestStream.SendDataAsync(Encoding.UTF8.GetBytes("Hello world")); await requestStream.SendHeadersAsync(trailers, endStream: false); await requestStream.SendDataAsync(Encoding.UTF8.GetBytes("This is invalid."));