Skip to content

SendAsync_ConcurentSendReceive_Ok is failing in CI #33141

@wfurt

Description

@wfurt

We had 24 failures in the last 90 days. It either fails with IOException or with NullReferenceException. I was able to reproduce latter in my local runs:

System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Authentication_Test.Credentials_DomainJoinedServerUsesKerberos_Success [SKIP]
      Condition(s) not met: "IsDomainJoinedServerAvailable"
      System.NullReferenceException : Object reference not set to an instance of an object.
      Stack Trace:
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs(1931,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Http2.DuplexContent.SerializeToStreamAsync(Stream stream, TransportContext context)
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/src/System/Net/Http/HttpContent.cs(374,0): at System.Net.Http.HttpContent.CopyToAsyncCore(ValueTask copyTask)
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs(183,0): at System.Net.Http.Http2Connection.Http2Stream.SendRequestBodyAsync(CancellationToken cancellationToken)
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs(1770,0): at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs(738,0): at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs(33,0): at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs(581,0): at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts, CancellationToken callerToken, Int64 timeoutTime)
        /mnt/github/wfurt-runtime2/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs(2732,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Http2.SendAsync_ConcurentSendReceive_Ok(Boolean shouldWaitForRequestBody, HttpStatusCode responseCode)
        --- End of stack trace from previous location ---
    System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_HttpClientHandlerTest_Http2.ReadAsStreamAsync_HandlerProducesWellBehavedResponseStream(chunked: True) [SKIP]
      Chunking is not supported on HTTP/2 and later.
    System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_HttpClientHandlerTest_Http2.GetAsync_SecureAndNonSecureIPBasedUri_CorrectlyFormatted(address: 127.0.0.1, useSsl: True) [SKIP]

            protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
            {
                _waitForCompletion = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
                _waitForStream.SetResult(stream);
                await _waitForCompletion.Task;
            }

from quick debug, it seems like this part of test runs before SerializeToStreamAsync completes. (Complete() sets _waitForCompletion back to null)

await requestStream.WriteAsync(Encoding.UTF8.GetBytes(requestContent));
duplexContent.Complete();

From duplicate reports (#33661), the IOException:

System.IO.IOException : Got RST

at System.Net.Test.Common.Http2LoopbackConnection.ReadBodyAsync() in /_/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs:line 474
at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Http2.SendAsync_ConcurentSendReceive_Ok(Boolean shouldWaitForRequestBody, HttpStatusCode responseCode) in /_/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs:line 2715

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions