diff --git a/src/libraries/System.Linq.Parallel/src/System.Linq.Parallel.csproj b/src/libraries/System.Linq.Parallel/src/System.Linq.Parallel.csproj index dc8a4cd971b57e..af337bc39dd611 100644 --- a/src/libraries/System.Linq.Parallel/src/System.Linq.Parallel.csproj +++ b/src/libraries/System.Linq.Parallel/src/System.Linq.Parallel.csproj @@ -5,7 +5,12 @@ true false - + + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) + true + $(DefineConstants);FEATURE_WASM_THREADS + + diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs index 1da235729da749..0552ded75cb5f2 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs @@ -64,8 +64,12 @@ public static class ParallelEnumerable // When running in single partition mode, PLINQ operations will occur on a single partition and will not // be executed in parallel, but will retain PLINQ semantics (exceptions wrapped as aggregates, etc). +#if !FEATURE_WASM_THREADS [System.Runtime.Versioning.SupportedOSPlatformGuard("browser")] internal static bool SinglePartitionMode => OperatingSystem.IsBrowser(); +#else + internal static bool SinglePartitionMode => false; +#endif //----------------------------------------------------------------------------------- // Converts any IEnumerable into something that can be the target of parallel diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System.Threading.Tasks.Parallel.csproj b/src/libraries/System.Threading.Tasks.Parallel/src/System.Threading.Tasks.Parallel.csproj index 7272b6a3d1b009..8d96b68a876420 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System.Threading.Tasks.Parallel.csproj +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System.Threading.Tasks.Parallel.csproj @@ -5,7 +5,11 @@ true false - + + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) + true + $(DefineConstants);FEATURE_WASM_THREADS + diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs index 1ada79b833a11a..c08d76b8927c25 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs @@ -238,8 +238,12 @@ public static void Invoke(ParallelOptions parallelOptions, params Action[] actio { // If we've gotten this far, it's time to process the actions. +#if !FEATURE_WASM_THREADS // Web browsers need special treatment that is implemented in TaskReplicator if (OperatingSystem.IsBrowser() || +#else + if ( +#endif // This is more efficient for a large number of actions, or for enforcing MaxDegreeOfParallelism: (actionsCopy.Length > SMALL_ACTIONCOUNT_LIMIT) || (parallelOptions.MaxDegreeOfParallelism != -1 && parallelOptions.MaxDegreeOfParallelism < actionsCopy.Length) diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs index 28287184542b39..eb09ba672f4239 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs @@ -131,6 +131,7 @@ public static void Run(ReplicatableUserAction action, ParallelOp { // Browser hosts do not support synchronous Wait so we want to run the // replicated task directly instead of going through Task infrastructure +#if !FEATURE_WASM_THREADS if (OperatingSystem.IsBrowser()) { // Since we are running on a single thread, we don't want the action to time out @@ -142,6 +143,7 @@ public static void Run(ReplicatableUserAction action, ParallelOp throw new Exception("Replicated tasks cannot yield in this single-threaded browser environment"); } else +#endif { int maxConcurrencyLevel = (options.EffectiveMaxConcurrencyLevel > 0) ? options.EffectiveMaxConcurrencyLevel : int.MaxValue; diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs index fbcbdc87f1931c..77c16ddd72c928 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs @@ -293,7 +293,6 @@ static IEnumerable IterateUntilSet(StrongBox box) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Async() { static async IAsyncEnumerable IterateUntilSet(StrongBox box) @@ -328,7 +327,6 @@ static async IAsyncEnumerable IterateUntilSet(StrongBox box) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task RunsAsynchronously_For() { var cts = new CancellationTokenSource(); @@ -342,7 +340,6 @@ public async Task RunsAsynchronously_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Sync() { static IEnumerable Iterate() @@ -361,7 +358,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Async() { #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously @@ -382,7 +378,6 @@ static async IAsyncEnumerable IterateAsync() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(-1)] [InlineData(1)] [InlineData(2)] @@ -422,7 +417,6 @@ static async IAsyncEnumerable IterateUntilSetAsync(StrongBox box) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void EmptyRange_For() { int counter = 0; @@ -437,7 +431,6 @@ public void EmptyRange_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task EmptySource_Sync() { int counter = 0; @@ -451,7 +444,6 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 0), (item, cancellationToken) => } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task EmptySource_Async() { int counter = 0; @@ -465,7 +457,6 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(0, 0), (item, cancellationToken } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_For(bool yield) @@ -511,7 +502,6 @@ await Parallel.ForAsync(T.CreateTruncating(Start), T.CreateTruncating(Start + Co } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_Sync(bool yield) @@ -542,7 +532,6 @@ await Parallel.ForEachAsync(Enumerable.Range(Start, Count), async (item, cancell } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_Async(bool yield) @@ -573,7 +562,6 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(Start, Count, yield), async (it } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_For(bool defaultScheduler) @@ -602,7 +590,6 @@ public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_For(bool defau } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Sync(bool defaultScheduler) @@ -641,7 +628,6 @@ IEnumerable Iterate() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Async(bool defaultScheduler) @@ -681,7 +667,6 @@ async IAsyncEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_For() { using var cts = new CancellationTokenSource(10); @@ -714,7 +699,6 @@ static async IAsyncEnumerable Infinite() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Async() { static async IAsyncEnumerable InfiniteAsync() @@ -736,7 +720,6 @@ static async IAsyncEnumerable InfiniteAsync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_CorrectTokenPassedToAsyncEnumerator() { static async IAsyncEnumerable YieldTokenAsync([EnumeratorCancellation] CancellationToken cancellationToken) @@ -753,7 +736,6 @@ await Parallel.ForEachAsync(YieldTokenAsync(default), (item, cancellationToken) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_For() { var cq = new ConcurrentQueue(); @@ -769,7 +751,6 @@ await Parallel.ForAsync(1, 101, async (item, cancellationToken) => } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_Sync() { var cq = new ConcurrentQueue(); @@ -785,7 +766,6 @@ await Parallel.ForEachAsync(Enumerable.Range(1, 100), async (item, cancellationT } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_Async() { var cq = new ConcurrentQueue(); @@ -801,7 +781,6 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(1, 100), async (item, cancellat } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_For() { var tcs = new TaskCompletionSource(); @@ -828,7 +807,6 @@ public async Task Cancellation_HasPriorityOverExceptions_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_Sync() { static IEnumerable Iterate() @@ -861,7 +839,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_Async() { static async IAsyncEnumerable Iterate() @@ -898,7 +875,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task Cancellation_FaultsForOceForNonCancellation_For(bool internalToken) @@ -915,7 +891,6 @@ public async Task Cancellation_FaultsForOceForNonCancellation_For(bool internalT } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task Cancellation_FaultsForOceForNonCancellation(bool internalToken) @@ -942,7 +917,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0, 4)] [InlineData(1, 4)] [InlineData(2, 4)] @@ -975,7 +949,6 @@ public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut_Fo } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0, 4)] [InlineData(1, 4)] [InlineData(2, 4)] @@ -1008,7 +981,6 @@ public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut(in } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_FromGetEnumerator_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default); @@ -1018,7 +990,6 @@ public void Exception_FromGetEnumerator_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_FromGetEnumerator_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default); @@ -1028,7 +999,6 @@ public void Exception_FromGetEnumerator_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_NullFromGetEnumerator_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default); @@ -1038,7 +1008,6 @@ public void Exception_NullFromGetEnumerator_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_NullFromGetEnumerator_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default); @@ -1048,7 +1017,6 @@ public void Exception_NullFromGetEnumerator_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromMoveNext_Sync() { static IEnumerable Iterate() @@ -1069,7 +1037,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromMoveNext_Async() { static async IAsyncEnumerable Iterate() @@ -1091,7 +1058,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromLoopBody_For() { var barrier = new Barrier(2); @@ -1113,7 +1079,6 @@ public async Task Exception_FromLoopBody_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromLoopBody_Sync() { static IEnumerable Iterate() @@ -1141,7 +1106,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromLoopBody_Async() { static async IAsyncEnumerable Iterate() @@ -1183,7 +1147,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDispose_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default); @@ -1192,7 +1155,6 @@ public async Task Exception_FromDispose_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDispose_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default); @@ -1201,7 +1163,6 @@ public async Task Exception_FromDispose_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDisposeAndCancellationCallback_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsExceptionFromDisposeAndCancellationCallback(), (item, cancellationToken) => default); @@ -1211,7 +1172,6 @@ public async Task Exception_FromDisposeAndCancellationCallback_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDisposeAndCancellationCallback_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsExceptionFromDisposeAndCancellationCallback(), (item, cancellationToken) => default); @@ -1221,7 +1181,6 @@ public async Task Exception_FromDisposeAndCancellationCallback_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_ImplicitlyCancelsOtherWorkers_For() { await Assert.ThrowsAsync(() => Parallel.ForAsync(0, long.MaxValue, async (item, cancellationToken) => @@ -1250,7 +1209,6 @@ await Assert.ThrowsAsync(() => Parallel.ForAsync(0, long.MaxValue, as } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_ImplicitlyCancelsOtherWorkers_Sync() { static IEnumerable Iterate() @@ -1356,7 +1314,6 @@ static async IAsyncEnumerable Iterate(Task signal) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ExecutionContext_FlowsToWorkerBodies_For(bool defaultScheduler) @@ -1375,7 +1332,6 @@ await Parallel.ForAsync(0, 100, async (item, cancellationToken) => } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ExecutionContext_FlowsToWorkerBodies_Sync(bool defaultScheduler) diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs index 39f1e2bb49822d..7ae7693fb20310 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs @@ -289,7 +289,6 @@ public static void RunSimpleParallelDoTest(int increms) [InlineData(1024)] [InlineData(1024 * 1024)] [InlineData(1024 * 1024 * 16)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunSimpleParallelForIncrementTest(int increms) { // Just increments a shared counter in a loop. @@ -320,7 +319,6 @@ public static void RunSimpleParallelForIncrementTest(int increms) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(-1)] [InlineData(0)] [InlineData(1)] @@ -454,7 +452,6 @@ public static void SequentialFor64ParityTest(long inclusiveFrom, long exclusiveT } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -484,7 +481,6 @@ public static void RunSimpleParallelForeachAddTest_Enumerable(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -515,7 +511,6 @@ public static void RunSimpleParallelForeachAddTest_List(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -546,7 +541,6 @@ public static void RunSimpleParallelForeachAddTest_Array(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -578,7 +572,6 @@ public static void RunSimpleParallelForAverageAggregation(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -718,7 +711,6 @@ public static void TestParallelForDOP() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TestParallelForPaths() { int loopsize = 1000; @@ -880,7 +872,6 @@ public static void TestParallelForPaths() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TestParallelForPaths_Exceptions() { int loopsize = 1000; @@ -1120,7 +1111,6 @@ public static void TestInvokeDOPAndCancel() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunParallelLoopCancellationTests() { int counter = 0; // Counts the actual number of iterations @@ -1255,7 +1245,6 @@ private static void VerifyCancelTestState( } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void CancelForIntTest() { for (int i = 0; i < 100; ++i) @@ -1290,7 +1279,6 @@ public static void CancelForIntTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void CancelForLongTest() { for (int i = 0; i < 100; ++i) @@ -1332,7 +1320,6 @@ public static IEnumerable CancelForEachTest_MemberData() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(CancelForEachTest_MemberData))] public static void CancelForEachTest(IEnumerable enumerable) {