Skip to content

Commit

Permalink
Fix race in FrameAfterTrailers_UnexpectedFrameError #30754 (#31061)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher authored Mar 19, 2021
1 parent de013d4 commit cc33b22
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down

0 comments on commit cc33b22

Please sign in to comment.