WASM: Disable thread related tests on System.IO.Compression (#39231)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 14 Jul 2020 09:54:20 +0000 (11:54 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Jul 2020 09:54:20 +0000 (11:54 +0200)
They try to test various conditions that only work if you have multiple threads which is not the case on WebAssembly.

src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs
src/libraries/tests.proj

index e8aeadb85765a7718d4fe0f4b64c98289d04cf96..90a6c35c0f2ad9bc1ea1fea7fd1222363399ac3d 100644 (file)
@@ -14,7 +14,7 @@ namespace System.IO.Compression
     {
         private const int TaskTimeout = 30 * 1000; // Generous timeout for official test runs
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public virtual void FlushAsync_DuringWriteAsync()
         {
             if (FlushNoOps)
@@ -49,7 +49,7 @@ namespace System.IO.Compression
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task FlushAsync_DuringReadAsync()
         {
             if (FlushNoOps)
@@ -78,7 +78,7 @@ namespace System.IO.Compression
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task FlushAsync_DuringFlushAsync()
         {
             if (FlushNoOps)
@@ -121,7 +121,7 @@ namespace System.IO.Compression
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public virtual void WriteAsync_DuringWriteAsync()
         {
             byte[] buffer = new byte[100000];
@@ -154,7 +154,7 @@ namespace System.IO.Compression
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_DuringReadAsync()
         {
             byte[] buffer = new byte[32];
@@ -179,7 +179,7 @@ namespace System.IO.Compression
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public virtual async Task Dispose_WithUnfinishedReadAsync()
         {
             string compressedPath = CompressedTestFile(UncompressedTestFile());
index ec074e10721d432e8f62351cd9de8e08b1fdad7d..96eb0aed551ca1a3bd268353d5616196a9d76cd5 100644 (file)
@@ -37,7 +37,6 @@
     <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization.Calendars\tests\System.Globalization.Calendars.Tests.csproj" />
     <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization.Extensions\tests\System.Globalization.Extensions.Tests.csproj" />
     <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization\tests\System.Globalization.Tests.csproj" />
-    <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Compression\tests\System.IO.Compression.Tests.csproj" />
     <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem.DriveInfo\tests\System.IO.FileSystem.DriveInfo.Tests.csproj" />
     <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem\tests\System.IO.FileSystem.Tests.csproj" />
     <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.MemoryMappedFiles\tests\System.IO.MemoryMappedFiles.Tests.csproj" />