diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index bce044984e9379..982b8589e76c14 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -94,6 +94,7 @@ $(WasmXHarnessMonoArgs) --setenv=XHARNESS_LOG_TEST_START=true $(WasmXHarnessMonoArgs) --setenv=IsBrowserThreadingSupported=true + 8 @@ -112,6 +113,7 @@ <_XHarnessArgs Condition="'$(WasmXHarnessArgsCli)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgsCli) <_AppArgs Condition="'$(WasmEnableThreads)' == 'true'">$(_AppArgs) -threads + <_AppArgs Condition="'$(WasmXHarnessMaxParallelThreads)' != ''">$(_AppArgs) -parallelThreads $(WasmXHarnessMaxParallelThreads) $HARNESS_RUNNER $(_XHarnessArgs) %24XHARNESS_ARGS %24WasmXHarnessArgs -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs) %24WasmTestAppArgs %HARNESS_RUNNER% $(_XHarnessArgs) %XHARNESS_ARGS% %WasmXHarnessArgs% -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs) %WasmTestAppArgs% diff --git a/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.cs b/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.cs index 2eb1c1e440c33b..9935182c69d038 100644 --- a/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.cs +++ b/src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.cs @@ -9,8 +9,8 @@ public class WasmTestRunner : WasmApplicationEntryPoint { - // TODO: Set max threads for run in parallel - // protected override int? MaxParallelThreads => RunInParallel ? 8 : base.MaxParallelThreads; + protected int MaxParallelThreadsFromArg { get; set; } + protected override int? MaxParallelThreads => RunInParallel ? MaxParallelThreadsFromArg : base.MaxParallelThreads; public static async Task Main(string[] args) { @@ -65,9 +65,11 @@ public static async Task Main(string[] args) break; case "-threads": runner.IsThreadless = false; - // TODO: Enable run in parallel - // runner.RunInParallel = true; - // Console.WriteLine($"Running in parallel with {runner.MaxParallelThreads} threads."); + break; + case "-parallelThreads": + runner.MaxParallelThreadsFromArg = Math.Max(1, int.Parse(args[i + 1])); + runner.RunInParallel = runner.MaxParallelThreadsFromArg > 1; + i++; break; case "-verbosity": runner.MinimumLogLevel = Enum.Parse(args[i + 1]); @@ -105,4 +107,12 @@ public static async Task Main(string[] args) return res; } + + public override Task RunAsync() + { + if (RunInParallel) + Console.WriteLine($"Running in parallel with {MaxParallelThreads} threads."); + + return base.RunAsync(); + } } diff --git a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj index 0292fd4c043532..2c7762cc6bc861 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj +++ b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj @@ -17,6 +17,7 @@ 01:15:00 + 1 diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj index e21c5d8c5e16dc..135b1b78297ab8 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj @@ -14,6 +14,7 @@ true true + 1 diff --git a/src/libraries/System.Runtime/tests/System.Buffers.Tests/System.Buffers.Tests.csproj b/src/libraries/System.Runtime/tests/System.Buffers.Tests/System.Buffers.Tests.csproj index 10b79281bf52b6..66ae6833a50eb5 100644 --- a/src/libraries/System.Runtime/tests/System.Buffers.Tests/System.Buffers.Tests.csproj +++ b/src/libraries/System.Runtime/tests/System.Buffers.Tests/System.Buffers.Tests.csproj @@ -5,6 +5,9 @@ true $(NetCoreAppCurrent) + + 1 + diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj index ddb87ab85f5745..61bea23cac8200 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj @@ -21,6 +21,7 @@ true 01:15:00 + 1