runtime: BufferedAsyncFileStreamStandaloneConformanceTests.Read_EmptyStream_Nop_Success failing with PNSE

Test

System.IO.Tests.BufferedAsyncFileStreamStandaloneConformanceTests.Read_EmptyStream_Nop_Success (Multiple variants)

  • Failing since ~30/10~ #44069
  • On queues: ubuntu.1804.amd64.open, windows.10.amd64.server19h1.es.open, windows.81.amd64.open

https://dev.azure.com/dnceng/public/_build/results?buildId=874130&view=ms.vss-test-web.build-test-results-tab

Error Message

Linux:

System.PlatformNotSupportedException : Cannot wait on monitors on this runtime.

Windows:

System.PlatformNotSupportedException : This API is specific to the way in which Windows handles asynchronous I/O, and is not supported on this platform.

Stack Trace

Linux

   at System.Threading.Monitor.ObjWait(Int32 millisecondsTimeout, Object obj)
   at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout)
   at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.InternalWaitCore(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.IO.FileStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Stream.Read(Span`1 buffer)
   at System.IO.FileStream.Read(Span`1 buffer)
   at System.IO.Tests.StreamConformanceTests.ReadAsync(ReadWriteMode mode, Stream stream, Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at System.IO.Tests.StandaloneStreamConformanceTests.Read_EmptyStream_Nop_Success(ReadWriteMode mode)
--- End of stack trace from previous location ---

Windows

   at System.Threading.ThreadPoolBoundHandle.BindHandle(SafeHandle handle) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.PlatformNotSupported.cs:line 24
   at System.IO.FileStream.Init(FileMode mode, FileShare share, String originalPath) in /_/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs:line 91
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in /_/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.cs:line 252
   at System.IO.Tests.FileStreamStandaloneConformanceTests.CreateStream(Byte[] initialData, FileAccess access) in /_/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.cs:line 23
   at System.IO.Tests.FileStreamStandaloneConformanceTests.CreateReadOnlyStreamCore(Byte[] initialData) in /_/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.cs:line 26
   at System.IO.Tests.StandaloneStreamConformanceTests.CreateReadOnlyStream(Byte[] initialData) in /_/src/libraries/Common/tests/Tests/System/IO/StreamConformanceTests.cs:line 653
   at System.IO.Tests.StandaloneStreamConformanceTests.Read_EmptyStream_Nop_Success(ReadWriteMode mode) in /_/src/libraries/Common/tests/Tests/System/IO/StreamConformanceTests.cs:line 833
--- End of stack trace from previous location ---

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

I just tried this locally on Windows and all tests passed:

    [PlatformSpecific(~TestPlatforms.Windows)]
    public abstract class BaseClassWithPlatformSpecific
    {
        [Fact]
        public void Test1()
        {
            if (OperatingSystem.IsWindows()) throw new Exception("Shouldn't have run");
        }
    }

    public class DerivedClassWithBasePlatformSpecific : BaseClassWithPlatformSpecific
    {
        [Fact]
        public void Test2()
        {
            if (OperatingSystem.IsWindows()) throw new Exception("Shouldn't have run");
        }
    }

    [PlatformSpecific(~TestPlatforms.Windows)]
    public class PlatformSpecificWithoutBase
    {
        [Fact]
        public void Test3()
        {
            if (OperatingSystem.IsWindows()) throw new Exception("Shouldn't have run");
        }
    }

    [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindows))]
    public abstract class BaseClassWithConditionalClass
    {
        [Fact]
        public void Test4()
        {
            if (OperatingSystem.IsWindows()) throw new Exception("Shouldn't have run");
        }
    }

    public class DerivedClassWithBaseConditionalClass : BaseClassWithConditionalClass
    {
        [Fact]
        public void Test5()
        {
            if (OperatingSystem.IsWindows()) throw new Exception("Shouldn't have run");
        }
    }

    [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindows))]
    public class ConditionalClassWithoutBase
    {
        [Fact]
        public void Test6()
        {
            if (OperatingSystem.IsWindows()) throw new Exception("Shouldn't have run");
        }
    }

Maybe it’s something specific with how the tests are executed for browser?