Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky Kestrel Http/2 Stream tests #59820

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BrennanConroy
Copy link
Member

We use inline pipe scheduling which means the StartStreamAsync call will call continuations inline which will add the stream to the connection before returning. However, inline continuations relies on a continuation actually being present. So all these tests relied on a race condition where we had an active pipeReader.ReadAsync call in order to call the continuation inline. If you add a delay or pause the thread right before the ReadAsync in Http2Connection.cs then you can force the race and cause _connection._streams[1]; to fail as there is no stream present yet.

The fix is to make sure the stream is present, and we attain that by making sure the app code is running which is after the stream has been created.

@BrennanConroy BrennanConroy added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant