diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 394e0b84682e3e..3d35765aee1737 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -122,6 +122,7 @@ public static bool IsPrivilegedProcess public static bool IsThreadingSupported => (!IsWasi && !IsBrowser) || IsWasmThreadingSupported; public static bool IsWasmThreadingSupported => IsBrowser && IsEnvironmentVariableTrue("IsBrowserThreadingSupported"); + public static bool IsNotWasmThreadingSupported => !IsWasmThreadingSupported; public static bool IsBinaryFormatterSupported => IsNotMobile && !IsNativeAot; public static bool IsStartingProcessesSupported => !IsiOS && !IstvOS; diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Legacy.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Legacy.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs index 9536de4e5b3cbb..5f05887854207d 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Legacy.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Legacy.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs @@ -22,8 +22,8 @@ public static IEnumerable TestCases() yield return new object[] { new[] { 800, 600, 400, 200, 100 }, 5, 13, 9 }; } - [Theory] [MemberData(nameof(TestCases))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] // this test only makes sense with ST TimerQueue public async Task TestTimers(int[] timeouts, int? expectedSetCounter, int? expectedSetCounterAfterCleanUp, int? expectedHitCount) { int wasCalled = 0; diff --git a/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs b/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs index b165796005b948..fdd62265a1680d 100644 --- a/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs +++ b/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs @@ -50,7 +50,6 @@ public void Timer_Change_AfterDispose_Test() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(2)] diff --git a/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs b/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs index 0e00bd468563ce..81cf68b4f2c6d8 100644 --- a/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs +++ b/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs @@ -50,7 +50,6 @@ public void DisposeAsync_SignalsImmediatelyWhenTaskNotRunning() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_DisposeDelayedUntilCallbacksComplete() { using (var b = new Barrier(2)) @@ -73,7 +72,6 @@ public async Task DisposeAsync_DisposeDelayedUntilCallbacksComplete() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_MultipleDisposesBeforeCompletionReturnSameTask() { using (var b = new Barrier(2)) @@ -99,7 +97,6 @@ public async Task DisposeAsync_MultipleDisposesBeforeCompletionReturnSameTask() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_AfterDisposeWorks() { using (var b = new Barrier(2)) @@ -123,7 +120,6 @@ public async Task DisposeAsync_AfterDisposeWorks() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_AfterDisposeWaitHandleThrows() { using (var b = new Barrier(2)) @@ -146,7 +142,6 @@ public async Task DisposeAsync_AfterDisposeWaitHandleThrows() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_ThenDisposeWaitHandleReturnsFalse() { using (var b = new Barrier(2)) diff --git a/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs b/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs index b9d6f3cee554a9..046de9ad6fb1d4 100644 --- a/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs +++ b/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs @@ -17,7 +17,6 @@ public class TimerFiringTests internal const int MaxPositiveTimeoutInMs = 30000; [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Fires_After_DueTime_Ellapses() { AutoResetEvent are = new AutoResetEvent(false); @@ -32,7 +31,6 @@ public void Timer_Fires_After_DueTime_Ellapses() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Fires_AndPassesStateThroughCallback() { AutoResetEvent are = new AutoResetEvent(false); @@ -49,7 +47,6 @@ public void Timer_Fires_AndPassesStateThroughCallback() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Fires_AndPassesNullStateThroughCallback() { AutoResetEvent are = new AutoResetEvent(false); @@ -125,7 +122,6 @@ public void Timer_ChangeToDelete_DoesntFire() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_CanDisposeSelfInCallback() { Timer t = null; @@ -153,7 +149,6 @@ public void Timer_CanBeDisposedMultipleTimes() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NonRepeatingTimer_ThatHasAlreadyFired_CanChangeAndFireAgain() { AutoResetEvent are = new AutoResetEvent(false); @@ -168,7 +163,6 @@ public void NonRepeatingTimer_ThatHasAlreadyFired_CanChangeAndFireAgain() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void MultpleTimers_PeriodicTimerIsntBlockedByBlockedCallback() { int callbacks = 2; @@ -189,7 +183,6 @@ public void MultpleTimers_PeriodicTimerIsntBlockedByBlockedCallback() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ManyTimers_EachTimerDoesFire() { int maxTimers = 10000; @@ -207,7 +200,6 @@ public void ManyTimers_EachTimerDoesFire() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Constructor_CallbackOnly_Change() { var e = new ManualResetEvent(false); @@ -225,7 +217,6 @@ public void Timer_Dispose_WaitHandle_Negative() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Dispose_WaitHandle() { int tickCount = 0; @@ -371,7 +362,6 @@ orderby groupedByDueTime.Key } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TimersCreatedConcurrentlyOnDifferentThreadsAllFire() { int processorCount = Environment.ProcessorCount;