Skip to content

HTTP/3 Reenabled cookie tests - #56831

Merged
ManickaP merged 5 commits into
dotnet:mainfrom
ManickaP:mapichov/53093_enable_cookie_tests
Aug 6, 2021
Merged

ManickaP merged 5 commits into
dotnet:mainfrom
ManickaP:mapichov/53093_enable_cookie_tests

Conversation

@ManickaP

@ManickaP ManickaP commented Aug 4, 2021 •

Copy link
Copy Markdown
Member

It was dependent on #55025 which has been fixed, so I'm just re-enabling the tests.

I ran locally more than 100 loops of HTTP tests without any problems.

Fixes #53093

@ghost ghost added the area-System.Net.Http label Aug 4, 2021
@ghost

ghost commented Aug 4, 2021

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

It was dependent on #55025 which has been fixed, so I'm just re-enabling the tests.

I ran locally more than 100 loops of HTTP tests without any problems.

Fixes #53093

Author: ManickaP
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@ManickaP
ManickaP requested review from a team, geoffkizer and wfurt August 4, 2021 12:12
@wfurt

wfurt commented Aug 4, 2021

Copy link
Copy Markdown
Member
    System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_Cookies_Http3_Mock.GetAsyncWithRedirect_ReceiveSetCookie_CookieSent [FAIL]
      System.Net.Http.HttpRequestException : An error occurred while sending the request.
      ---- System.Net.Quic.QuicStreamAbortedException : Stream aborted by peer (267).
      Stack Trace:
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs(246,0): at System.Net.Http.Http3RequestStream.SendAsync(CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs(292,0): at System.Net.Http.Http3RequestStream.SendAsync(CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3Connection.cs(213,0): at System.Net.Http.Http3Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs(927,0): at System.Net.Http.HttpConnectionPool.TrySendUsingHttp3Async(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs(989,0): at System.Net.Http.HttpConnectionPool.DetermineVersionAndSendAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs(1019,0): at System.Net.Http.HttpConnectionPool.SendAndProcessAltSvcAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs(1038,0): at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs(81,0): at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs(527,0): at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
        /_/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs(616,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Cookies.<GetAsyncWithRedirect_ReceiveSetCookie_CookieSent>b__26_0(Uri url)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(64,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(91,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs(38,0): at System.Net.Test.Common.LoopbackServerFactory.<>c__DisplayClass5_0.<<CreateClientAndServerAsync>b__0>d.MoveNext()
        --- End of stack trace from previous location ---
        /_/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs(98,0): at System.Net.Test.Common.Http3LoopbackServerFactory.CreateServerAsync(Func`3 funcAsync, Int32 millisecondsTimeout, GenericLoopbackOptions options)
        /_/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs(607,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Cookies.GetAsyncWithRedirect_ReceiveSetCookie_CookieSent()
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockStream.cs(76,0): at System.Net.Quic.Implementations.Mock.MockStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs(721,0): at System.Net.Http.Http3RequestStream.ReadFrameEnvelopeAsync(CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs(305,0): at System.Net.Http.Http3RequestStream.ReadResponseAsync(CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs(195,0): at System.Net.Http.Http3RequestStream.SendAsync(CancellationToken cancellationToken)
  Finished:    System.Net.Http.Functional.Tests
=== TEST EXECUTION SUMMARY ===

ignore Mock for now...?

@ManickaP

ManickaP commented Aug 4, 2021 •

Copy link
Copy Markdown
Member Author

I re-disabled the mock version. I created a new issue for that and this PR will close the original multi-issue.

@ManickaP
ManickaP force-pushed the mapichov/53093_enable_cookie_tests branch from e7dcc1c to 54860df Compare August 4, 2021 21:13
@geoffkizer

Copy link
Copy Markdown
Contributor

Error code 267 is H3_REQUEST_REJECTED, which is coming from the loopback server.

What happens here is that the cookie test is issuing an H3 request that will result in a redirect. The redirect handling logic then issues a second request for the redirect.

Meanwhile, the server logic here is sending the first response and then closing the connection gracefully (i.e., sending GOAWAY and then waiting for the client to close the connection). As part of the graceful shutdown logic, it rejects any new requests with H3_REQUEST_REJECTED, which indicates to the client that it should retry the request on a new connection.

So there's an inherent race here. It should be handled by the client checking for H3_REQUEST_REJECTED and retrying the request on a new connection. We have this sort of logic for HTTP2, but it seems we either aren't doing this for HTTP3 or are not doing it properly.

I suspect that that this is not a Mock-specific issue; it's just timing related (and thus probably happens more in CI, unfortunately).

@ManickaP
ManickaP force-pushed the mapichov/53093_enable_cookie_tests branch from 5f3fcc3 to 7faf34c Compare August 5, 2021 12:53
@ManickaP

ManickaP commented Aug 5, 2021

Copy link
Copy Markdown
Member Author

Error code 267 is H3_REQUEST_REJECTED, which is coming from the loopback server.

I added handling similar to what we have in H/2.

However, if I ran the test in a tight loop, I still saw failures at around iteration 600, failing the MaxRetry limit:

if (retryCount == MaxConnectionFailureRetries)
{
if (NetEventSource.Log.IsEnabled())
{
Trace($"MaxConnectionFailureRetries limit of {MaxConnectionFailureRetries} hit. Retryable request will not be retried. Exception: {e}");
}
throw;
}

I don't know if there's something that can be done about it. Are we somehow too slow to close the connection? Should we do some blocking/waiting there?

@ManickaP

ManickaP commented Aug 5, 2021

Copy link
Copy Markdown
Member Author

So I disable only those cookie tests that were using more than 1 server-side connection. And I disabled them only for H/3 --> in an if with ActiveIssue in comment.

@wfurt wfurt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM if it holds test runs.

@ManickaP

ManickaP commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

Failures are unrelated.

@ManickaP
ManickaP merged commit 50a60e7 into dotnet:main Aug 6, 2021
@ManickaP
ManickaP deleted the mapichov/53093_enable_cookie_tests branch August 6, 2021 07:30
@karelz karelz added this to the 6.0.0 milestone Aug 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2021
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.

[HTTP/3] Disabled test classes

5 participants