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

Server and client are synchronized via TaskCompletionSource #35569

Merged

Conversation

alnikola
Copy link
Contributor

Http2_PendingSend_SendsReset test fails because client sends the second request with EndOfStream flag sooner than the server reads the last RstStream frame of the first request. This is caused by too short delay before the second request is made on the client. This PR replaces Task.Delay with a synchronization via TaskCompletionSource.

Fixes #2131

@ghost
Copy link

ghost commented Apr 28, 2020

Tagging subscribers to this area: @dotnet/ncl
Notify danmosemsft if you want to be subscribed.

@aik-jahoda
Copy link
Contributor

Can you run the outerloop test to verify this fix?

@alnikola
Copy link
Contributor Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MihaZupan
Copy link
Member

Is this test long running (I see SlowTestStream)? If not, should this be moved to innerloop/outerloop reason updated?

@alnikola
Copy link
Contributor Author

It might take several seconds to complete, so I'd rather keep it in outerloop.

// Delay for a bit to ensure that the RST_STREAM for the previous request is sent before the next request starts.
await Task.Delay(2000);
// Wait until the RST_STREAM for the previous request is received before the next request starts.
await rstReceived.Task.TimeoutAfter(TimeSpan.FromSeconds(60));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

60

Do we have a standard timeout constant defined anywhere that we could use for consistency (and the ability to change all timeouts at once later) instead of hardcoding the 60?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already tried searching for such constant, but with no luck.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the second thought, I found Http2LoopbackServer.Timeout, but not sure if it's a right thing to use it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is TestConfiguration.PassingTestTimeoutMilliseconds but that may be too long. That generally puts cap on test execution. I think using loopback timeout would be fine in this case as it does not need to precise, right @alnikola? Maybe we can add something DefaultTimeout to loopback and than use it when appropriate. (like the Http2LoopbackServer.Timeout) That would allows us to adjust it globally if we ever need to on slow platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to find all places where we use an explicit timeout and put there some well-known value (e.g. TestConfiguration.PassingTestTimeoutMilliseconds or Http2LoopbackServer.Timeout). Will create a separate PR for this.

@alnikola alnikola merged commit 63ae78b into dotnet:master Apr 28, 2020
@alnikola alnikola deleted the alnikola/2131-pending-send-reset-test branch April 28, 2020 18:58
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Http2_PendingSend_SendsReset test failing in CI
7 participants