QuicStreamTests.WaitForReadsClosedAsync_ServerReadAborted_Throws failed with timeout
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
## Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1541017
Build error leg or test failing: System.Net.Quic.Tests.QuicStreamTests.WaitForReadsClosedAsync_ServerReadAborted_Throws
Pull request: https://github.com/dotnet/runtime/pull/131876
## Error Message
**DO NOT USE JSON BELOW IF THIS IS A BUILD BREAK** otherwise build analysis will allow pull requests to merge that break the build worse. For a build break, do not use this issue form. Make a regular new issue.
Fill the error message using [step by step known issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Build%20Analysis/KnownIssueJsonStepByStep.md).
```json
{
"ErrorMessage": ["QuicStreamTests.WaitForReadsClosedAsync_ServerReadAborted_Throws [FAIL]", "QuicException : The connection timed out from inactivity."],
"BuildRetry": false,
"ExcludeConsoleLog": false
}
```
```
Starting: System.Net.Quic.Functional.Tests (parallel test collections = on [6 threads], stop on fail = off)
MsQuic supported and using 'libmsquic.dylib 2.5.5.0 (b3945bb0c9e44463c93dac13e40975a7c3a526ca)' (OpenSSL).
System.Net.Quic.Tests.MsQuicPlatformDetectionTests.UnsupportedPlatforms_ThrowsPlatformNotSupportedException [SKIP]
Condition(s) not met: "IsQuicUnsupported"
System.Net.Quic.Tests.MsQuicTests.QuicRootedConnectionGetsReleased_ConnectFails [SKIP]
Condition(s) not met: "IsNotMonoRuntime"
System.Net.Quic.Tests.MsQuicTests.QuicRootedObjectGetReleased [SKIP]
Condition(s) not met: "IsNotMonoRuntime"
System.Net.Quic.Tests.QuicStreamTests.WaitForReadsClosedAsync_ServerReadAborted_Throws [FAIL]
System.Net.Quic.QuicException : The connection timed out from inactivity.
Stack Trace:
/_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs(654,0): at System.Net.Quic.QuicConnection.HandleEventShutdownInitiatedByTransport(_SHUTDOWN_INITIATED_BY_TRANSPORT_e__Struct& data)
/_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs(768,0): at System.Net.Quic.QuicConnection.HandleConnectionEvent(QUIC_CONNECTION_EVENT& connectionEvent)
/_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs(803,0): at System.Net.Quic.QuicConnection.NativeCallback(QUIC_HANDLE* connection, Void* context, QUIC_CONNECTION_EVENT* connectionEvent)
--- End of stack trace from previous location ---
/_/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/ValueTaskSource.cs(176,0): at System.Net.Quic.ValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
/_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs(449,0): at System.Net.Quic.QuicConnection.FinishConnectAsync(QuicClientConnectionOptions options, CancellationToken cancellationToken)
/_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs(86,0): at System.Net.Quic.QuicConnection.g__StartConnectAsync|2_0(QuicClientConnectionOptions options, CancellationToken cancellationToken)
/_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs(101,0): at System.Net.Quic.QuicConnection.g__StartConnectAsync|2_0(QuicClientConnectionOptions options, CancellationToken cancellationToken)
/_/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs(222,0): at System.Net.Quic.Tests.QuicTestBase.CreateConnectedQuicConnection(QuicClientConnectionOptions clientOptions, QuicListener listener)
/_/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs(253,0): at System.Net.Quic.Tests.QuicTestBase.CreateConnectedQuicConnection(QuicClientConnectionOptions clientOptions, QuicListener listener)
/_/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs(299,0): at System.Net.Quic.Tests.QuicTestBase.RunClientServer(Func`2 clientFunction, Func`2 serverFunction, Int32 iterations, Int32 millisecondsTimeout, QuicListenerOptions listenerOptions)
/_/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs(297,0): at System.Net.Quic.Tests.QuicTestBase.RunClientServer(Func`2 clientFunction, Func`2 serverFunction, Int32 iterations, Int32 millisecondsTimeout, QuicListenerOptions listenerOptions)
/_/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs(342,0): at System.Net.Quic.Tests.QuicTestBase.RunStreamClientServer(Func`2 clientFunction, Func`2 serverFunction, Boolean bidi, Int32 iterations, Int32 millisecondsTimeout)
/_/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs(874,0): at System.Net.Quic.Tests.QuicStreamTests.WaitForReadsClosedAsync_ServerReadAborted_Throws()
--- End of stack trace from previous location ---
MsQuic Counters:
CONN_CREATED 1619
CONN_HANDSHAKE_FAIL 25
CONN_APP_REJECT 8
CONN_LOAD_REJECT 0
Unobserved exceptions of 1 different types:
Count 1: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Cannot access a disposed object.
Object name: 'System.Net.Quic.QuicListener'.)
---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Quic.QuicListener'.
at System.Net.Quic.QuicListener.DisposeAsync() in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs:line 432
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[d__21](d__21& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at System.Net.Quic.QuicListener.DisposeAsync()
at System.Net.Quic.Tests.QuicTestBase.RunClientServer(Func`2 clientFunction, Func`2 serverFunction, Int32 iterations, Int32 millisecondsTimeout, QuicListenerOptions listenerOptions) in /_/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs:line 297
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Net.Quic.Tests.QuicTestBase.d__40, System.Net.Quic.Functional.Tests, Version=11.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].ExecutionContextCallback(Object s) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 424
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 196
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Net.Quic.Tests.QuicTestBase.d__40, System.Net.Quic.Functional.Tests, Version=11.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext(Thread threadPoolThread, Flags flags) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 524
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Net.Quic.Tests.QuicTestBase.d__40, System.Net.Quic.Functional.Tests, Version=11.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 496
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Net.Quic.Tests.QuicTestBase.d__40, System.Net.Quic.Functional.Tests, Version=11.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext() in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 482
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.<>c.<.cctor>b__8_0(Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskContinuation.cs:line 370
at Xunit.Sdk.AsyncTestSyncContext.<>c__DisplayClass7_0.b__0() in /_/src/xunit.execution/Sdk/AsyncTestSyncContext.cs:line 58
at Xunit.Sdk.XunitWorkerThread.<>c.b__5_0(Object _) in /_/src/common/XunitWorkerThread.cs:line 37
at System.Threading.Tasks.Task.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2556
at System.Threading.Tasks.Task.<>c.<.cctor>b__291_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2538
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 196
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2496
at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2434
at System.Threading.Tasks.ThreadPoolTaskScheduler.<>c.<.cctor>b__8_0(Object s) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs:line 36
at System.Threading.Thread.StartCallback() in /_/src/mono/System.Private.CoreLib/src/System/Threading/Thread.Mono.cs:line 218
--- End of stack trace from previous location ---
at System.Net.Quic.QuicListener.AcceptConnectionAsync(CancellationToken cancellationToken) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs:line 197
--- End of inner exception stack trace ---
Finished: System.Net.Quic.Functional.Tests
```
The closed https://github.com/dotnet/runtime/issues/105177 looks somewhat similar, but I have no idea if it's actually related.
### Known issue validation
**Build: :mag_right:** https://dev.azure.com/dnceng-public/public/_build/results?buildId=1541017
**Error message validated:** `[QuicStreamTests.WaitForReadsClosedAsync_ServerReadAborted_Throws [FAIL] QuicException : The connection timed out from inactivity.`]
**Result validation:** :white_check_mark: Known issue matched with the provided build.
**Validation performed at:** 8/6/2026 3:41:18 PM UTC
### Report
|Build|Repository|Test|Pull Request|
|---|---|---|---|
|[1559738](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1559738)|dotnet/runtime|[System.Net.Quic.Tests.QuicStreamTests.WaitForReadsClosedAsync_ServerReadAborted_Throws](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1559738&view=ms.vss-test-web.build-test-results-tab&runId=42940342&resultId=142332)|dotnet/runtime#131969|
#### Summary
|24-Hour Hit Count|7-Day Hit Count|1-Month Count|
|---|---|---|
|0|0|1|
Contributor guide
Research direction
Start with WaitForReadsClosedAsync_ServerReadAborted_Throws in src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs around line 874, then read QuicTestBase.cs around lines 222-342 and the QuicConnection shutdown handling around lines 654-803. Re-run the named functional test and inspect the timeout and unobserved QuicListener disposal exception. Done means the test completes without the inactivity timeout or related cleanup failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100