Server and client are synchronized via TaskCompletionSource (#35569)
authorAlexander Nikolaev <55398552+alnikola@users.noreply.github.com>
Tue, 28 Apr 2020 18:58:49 +0000 (20:58 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Apr 2020 18:58:49 +0000 (20:58 +0200)
commit63ae78b28b6dbbb01df93b688218ac8737fb4d65
treefb8a4cc1d3157c12797d22497b31f214ba71c66b
parentce52022e5c7d47b6ab420f8d8763bff9cea5f769
Server and client are synchronized via TaskCompletionSource (#35569)

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
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs