dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.15k stars 4.71k forks source link

Test failure: System.Threading.Channels.Tests.ChannelTests/DefaultReadAsync_CatchesTryWriteExceptions #24117

Closed ghost closed 4 years ago

ghost commented 6 years ago

Opened on behalf of @Sunny-pu

The test System.Threading.Channels.Tests.ChannelTests/DefaultReadAsync_CatchesTryWriteExceptions has failed.

Assert.Equal() Failure\r Expected: Faulted\r Actual: RanToCompletion

    Stack Trace:

       at System.Threading.Channels.Tests.ChannelTests.<DefaultReadAsync_CatchesTryWriteExceptions>d__10.MoveNext() in E:\A\_work\722\s\corefx\src\System.Threading.Channels\tests\ChannelTests.cs:line 134
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150

Build : Master - 20171113.01 (UWP ILC Tests) Failing configurations:

danmoseley commented 6 years ago

@stephentoub this is your test. Is CoreRT missing something?

stephentoub commented 6 years ago

Is CoreRT missing something?

The test and the associated library code looks correct to me. I don't see how it could fail on a correctly functioning runtime. The test is deterministic. It calls ReadAsync (https://github.com/dotnet/corefx/blob/c40b68559e52eccd68b6616ea7a023c1c8f4361e/src/System.Threading.Channels/src/System/Threading/Channels/ChannelReader.cs#L37), which calls TryRead (https://github.com/dotnet/corefx/blob/c40b68559e52eccd68b6616ea7a023c1c8f4361e/src/System.Threading.Channels/tests/ChannelTests.cs#L201), which throws an exception that's caught and returned synchronously from the ReadAsync invocation (https://github.com/dotnet/corefx/blob/c40b68559e52eccd68b6616ea7a023c1c8f4361e/src/System.Threading.Channels/src/System/Threading/Channels/ChannelReader.cs#L53). That task was created with an exception, but the assert that's failing is saying it was instead completed successfully (https://github.com/dotnet/corefx/blob/c40b68559e52eccd68b6616ea7a023c1c8f4361e/src/System.Threading.Channels/tests/ChannelTests.cs#L134).

joshfree commented 6 years ago

@MichalStrehovsky

tarekgh commented 6 years ago

I am closing this one as we are not currently running uap tests on corefx and this is clearly not a library issue. we can reopen if the test continue to fail when enabling uap back.