From 28916631ac58ef4cc82bd38c8e14be17a8ed0ecc Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Mon, 23 Nov 2026 16:23:07 -0600 Subject: [PATCH 1/8] [wasm64] Run CoreCLR browser library tests in the libraries outerloop Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/libraries/helix-queues-setup.yml | 2 +- eng/pipelines/libraries/outerloop.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 9e00ebdc373f4b..7cbce3032b83df 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -181,7 +181,7 @@ jobs: - (Ubuntu.2604.Amd64.Open)AzureLinux.4.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:ad1f7dcade2316b01be4f731474775e2d82e7bf40f8e54c9af848b5a66a7b735 # Browser WebAssembly - - ${{ if eq(parameters.platform, 'browser_wasm') }}: + - ${{ if in(parameters.platform, 'browser_wasm', 'browser_wasm64') }}: - (Ubuntu.2604.Amd64.Open)AzureLinux.4.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:ad1f7dcade2316b01be4f731474775e2d82e7bf40f8e54c9af848b5a66a7b735 # Browser WebAssembly Firefox diff --git a/eng/pipelines/libraries/outerloop.yml b/eng/pipelines/libraries/outerloop.yml index 2df660f73a7416..322b58d4a6f279 100644 --- a/eng/pipelines/libraries/outerloop.yml +++ b/eng/pipelines/libraries/outerloop.yml @@ -141,6 +141,7 @@ extends: runtimeFlavor: coreclr platforms: - browser_wasm + - browser_wasm64 jobParameters: testScope: all nameSuffix: LibraryTestsCoreCLR @@ -169,6 +170,7 @@ extends: parameters: platforms: - browser_wasm + - browser_wasm64 nameSuffix: _R2R readyToRun: true testScope: all From d498498d8a9d6a5e57f54cd65eed210c7a025f64 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 24 Nov 2026 11:33:29 -0600 Subject: [PATCH 2/8] Skip NonBacktracking deep-nesting stress test on single-threaded wasm StackHelper.CallOnEmptyStack uses Task.Run and Wait, which single-threaded browser runtimes don't support. The test is 64-bit-only, so it first ran on browser with wasm64. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../tests/FunctionalTests/Regex.Match.Tests.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs index 4c14d842eb1c4a..784f99260d7741 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs @@ -2719,6 +2719,11 @@ public async Task StressTestDeepNestingOfLoops(RegexEngine engine, string begin, string fullpattern = string.Concat(Enumerable.Repeat(begin, pattern_repetition)) + inner + string.Concat(Enumerable.Repeat(end, pattern_repetition)); string fullinput = string.Concat(Enumerable.Repeat(input, input_repetition)); + if (RegexHelpers.IsNonBacktracking(engine) && !expectNotSupported && !PlatformDetection.IsMultithreadingSupported) + { + throw new SkipTestException("Deep nesting with NonBacktracking hits threading APIs not supported on single-threaded WASM."); + } + if (expectNotSupported) { // NonBacktracking rejects deeply nested unbounded capturing loops via the From a11a0eefc96f3aa1848be67bbbd7ceff39a523a9 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 24 Nov 2026 11:33:29 -0600 Subject: [PATCH 3/8] Skip multi-gigabyte Utf8JsonWriter outerloop tests on browser WritingTooLargeBase64Bytes and WriteTooLargeArguments take hours on the browser interpreter, timing out the wasm64 outerloop suite. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs index e0828b3e97784b..2b485021599afe 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs @@ -3518,6 +3518,7 @@ public void WritingTooLargePropertyStandalone(JsonWriterOptions options) [ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))] [OuterLoop] + [SkipOnPlatform(TestPlatforms.Browser, "Allocates and fills multi-gigabyte buffers, which takes hours on the browser interpreter")] [MemberData(nameof(JsonOptions_TestData))] public void WritingTooLargeBase64Bytes(JsonWriterOptions options) { @@ -6978,6 +6979,7 @@ private static void WriteStringHelper(JsonEncodedText text, string expectedMessa [ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))] [OuterLoop] + [SkipOnPlatform(TestPlatforms.Browser, "Allocates and fills multi-gigabyte buffers, which takes hours on the browser interpreter")] [MemberData(nameof(JsonOptions_TestData))] public void WriteTooLargeArguments(JsonWriterOptions options) { From de0287bc218cd8d06c59aefb68af8d840ac8ef44 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 24 Nov 2026 12:26:51 -0600 Subject: [PATCH 4/8] [wasm64] Give browser-wasm64 outerloop library suites a 6-hour budget System.Memory.Tests takes ~2h54m on wasm32 and exceeds the 4-hour suite timeout on wasm64, which is slower and also runs the 64-bit-only tests. Raise the wasm64 suite timeout and Helix batch bounds; the AzDO job timeout (600 minutes) still covers them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.wasm.targets | 2 ++ src/libraries/sendtohelix-browser.targets | 3 +++ 2 files changed, 5 insertions(+) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index c8a13c00047ece..e30b1a827fa9e1 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -37,6 +37,8 @@ Innerloop keeps the existing 01:30:00 budget. Keep this in sync with the per-batch and AzDO job timeouts in src/libraries/sendtohelix-browser.targets and eng/pipelines/libraries/outerloop.yml (suite <= batch <= job). --> + + 06:00:00 04:00:00 01:30:00 $(BundleDir) diff --git a/src/libraries/sendtohelix-browser.targets b/src/libraries/sendtohelix-browser.targets index 0c4d4c84f3884a..a32aa02d88131e 100644 --- a/src/libraries/sendtohelix-browser.targets +++ b/src/libraries/sendtohelix-browser.targets @@ -54,8 +54,11 @@ <_IsOuterloopTestScope Condition="'$(TestScope)' == 'outerloop' or '$(TestScope)' == 'all'">true <_WasmBatchMinutesPerSuite Condition="'$(_WasmBatchMinutesPerSuite)' == '' and '$(_IsOuterloopTestScope)' == 'true'">40 <_WasmBatchMinutesPerSuite Condition="'$(_WasmBatchMinutesPerSuite)' == ''">20 + + <_WasmBatchMinimumMinutes Condition="'$(_WasmBatchMinimumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true' and '$(TargetArchitecture)' == 'wasm64'">390 <_WasmBatchMinimumMinutes Condition="'$(_WasmBatchMinimumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true'">270 <_WasmBatchMinimumMinutes Condition="'$(_WasmBatchMinimumMinutes)' == ''">30 + <_WasmBatchMaximumMinutes Condition="'$(_WasmBatchMaximumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true' and '$(TargetArchitecture)' == 'wasm64'">420 <_WasmBatchMaximumMinutes Condition="'$(_WasmBatchMaximumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true'">300 <_WasmBatchMaximumMinutes Condition="'$(_WasmBatchMaximumMinutes)' == ''">1439 From 0dfb301d5729f428d02e6bb2d8e673926d325ba0 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 24 Nov 2026 22:23:21 -0600 Subject: [PATCH 5/8] Skip multi-gigabyte allocation outerloop tests on browser CanResizeToMaxArraySize and Double.ToString_ValidLargeFormat run on browser-wasm64 because it is a 64-bit process. They grow wasm linear memory to 8-10 GB, which never shrinks, so Chrome stalls on Helix machines and the Common.Tests and System.Runtime.Tests suites hit the work item timeout. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs | 1 + .../tests/System.Runtime.Tests/System/DoubleTests.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs b/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs index 2294a166581a8e..e13a5f70391bd1 100644 --- a/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs +++ b/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs @@ -196,6 +196,7 @@ public void AddSeveralBytesRepeatedlyAndConsumeSeveralBytesRepeatedly_Success(bo [OuterLoop] [ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))] + [SkipOnPlatform(TestPlatforms.Browser, "Allocates multi-gigabyte buffers; wasm linear memory never shrinks, so the browser exhausts Helix machine memory")] [InlineData(true)] [InlineData(false)] public void CanResizeToMaxArraySize(bool usePool) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index 01b07b4f0102cc..5c7a70dd67b3b7 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -1099,6 +1099,7 @@ public static void ToString_ExactPowerOfTwo_Roundtrips(ulong bits, string expect [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))] // Requires a lot of memory [OuterLoop("Takes a long time, allocates a lot of memory")] [SkipOnMono("Frequently throws OOM on Mono")] + [SkipOnPlatform(TestPlatforms.Browser, "Allocates multi-gigabyte buffers; wasm linear memory never shrinks, so the browser exhausts Helix machine memory")] public static void ToString_ValidLargeFormat() { double d = 123.0; From 0d3a0163520d8415c5a167b8563d30920410c8c2 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 24 Nov 2026 22:23:21 -0600 Subject: [PATCH 6/8] Make PackedSimd nint/nuint tests pointer-size independent The load/store and logical-shift tests assumed four 32-bit lanes per Vector128, which fails on browser-wasm64 where nint is 64 bits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../tests/Wasm/PackedSimdTests.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Runtime.Intrinsics/tests/Wasm/PackedSimdTests.cs b/src/libraries/System.Runtime.Intrinsics/tests/Wasm/PackedSimdTests.cs index 892cb290b36a22..ccc5b4b9063e20 100644 --- a/src/libraries/System.Runtime.Intrinsics/tests/Wasm/PackedSimdTests.cs +++ b/src/libraries/System.Runtime.Intrinsics/tests/Wasm/PackedSimdTests.cs @@ -818,13 +818,18 @@ public unsafe void NativeUnsignedIntegerArithmeticTest() [Fact] public unsafe void NativeIntegerLoadStoreTest() { - nint[] values = new nint[] { 1, 2, 3, 4 }; + nint[] values = new nint[Vector128.Count]; + for (int i = 0; i < values.Length; i++) + { + values[i] = (nint)(i + 1); + } + fixed (nint* ptr = values) { var loaded = PackedSimd.LoadVector128(ptr); Assert.Equal(Vector128.Create(values.AsSpan()), loaded); - nint[] storeTarget = new nint[4]; + nint[] storeTarget = new nint[values.Length]; fixed (nint* storePtr = storeTarget) { PackedSimd.Store(storePtr, loaded); @@ -836,13 +841,18 @@ public unsafe void NativeIntegerLoadStoreTest() [Fact] public unsafe void NativeUnsignedIntegerLoadStoreTest() { - nuint[] values = new nuint[] { 1, 2, 3, 4 }; + nuint[] values = new nuint[Vector128.Count]; + for (int i = 0; i < values.Length; i++) + { + values[i] = (nuint)(i + 1); + } + fixed (nuint* ptr = values) { var loaded = PackedSimd.LoadVector128(ptr); Assert.Equal(Vector128.Create(values.AsSpan()), loaded); - nuint[] storeTarget = new nuint[4]; + nuint[] storeTarget = new nuint[values.Length]; fixed (nuint* storePtr = storeTarget) { PackedSimd.Store(storePtr, loaded); @@ -861,7 +871,7 @@ public void NativeIntegerShiftTest() var rightShiftLogical = PackedSimd.ShiftRightLogical(v, 2); Assert.Equal(Vector128.Create([(nint)64, (-64), 128, (-128)]), leftShift); Assert.Equal(Vector128.Create([(nint)4, (-4), 8, (-8)]), rightShiftArith); - Assert.Equal(Vector128.Create([(nint)4, 1073741820, 8, 1073741816]), rightShiftLogical); + Assert.Equal(Vector128.Create([(nint)4, unchecked((nint)((nuint)(nint)(-16) >> 2)), 8, unchecked((nint)((nuint)(nint)(-32) >> 2))]), rightShiftLogical); } [Fact] @@ -872,7 +882,7 @@ public void NativeUnsignedIntegerShiftTest() var leftShift = PackedSimd.ShiftLeft(v, 2); var rightShiftLogical = PackedSimd.ShiftRightLogical(v, 2); Assert.Equal(Vector128.Create([(nuint)64, unchecked((nuint)(-64)), (nuint)128, unchecked((nuint)(-128))]), leftShift); - Assert.Equal(Vector128.Create([(nuint)4, (nuint)1073741820, (nuint)8, (nuint)1073741816]), rightShiftLogical); + Assert.Equal(Vector128.Create([(nuint)4, unchecked((nuint)(-16)) >> 2, (nuint)8, unchecked((nuint)(-32)) >> 2]), rightShiftLogical); } [Fact] From cd6524ee679313acfa416d602519b6e42e0c5908 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 24 Nov 2026 23:17:04 -0600 Subject: [PATCH 7/8] [wasm64] Use TargetsWasm64 in the wasm64 outerloop timeout conditions Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.wasm.targets | 2 +- src/libraries/sendtohelix-browser.targets | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index e30b1a827fa9e1..f63849c78d3876 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -38,7 +38,7 @@ the per-batch and AzDO job timeouts in src/libraries/sendtohelix-browser.targets and eng/pipelines/libraries/outerloop.yml (suite <= batch <= job). --> - 06:00:00 + 06:00:00 04:00:00 01:30:00 $(BundleDir) diff --git a/src/libraries/sendtohelix-browser.targets b/src/libraries/sendtohelix-browser.targets index a32aa02d88131e..0dbd22ca8dded8 100644 --- a/src/libraries/sendtohelix-browser.targets +++ b/src/libraries/sendtohelix-browser.targets @@ -55,10 +55,10 @@ <_WasmBatchMinutesPerSuite Condition="'$(_WasmBatchMinutesPerSuite)' == '' and '$(_IsOuterloopTestScope)' == 'true'">40 <_WasmBatchMinutesPerSuite Condition="'$(_WasmBatchMinutesPerSuite)' == ''">20 - <_WasmBatchMinimumMinutes Condition="'$(_WasmBatchMinimumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true' and '$(TargetArchitecture)' == 'wasm64'">390 + <_WasmBatchMinimumMinutes Condition="'$(_WasmBatchMinimumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true' and '$(TargetsWasm64)' == 'true'">390 <_WasmBatchMinimumMinutes Condition="'$(_WasmBatchMinimumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true'">270 <_WasmBatchMinimumMinutes Condition="'$(_WasmBatchMinimumMinutes)' == ''">30 - <_WasmBatchMaximumMinutes Condition="'$(_WasmBatchMaximumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true' and '$(TargetArchitecture)' == 'wasm64'">420 + <_WasmBatchMaximumMinutes Condition="'$(_WasmBatchMaximumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true' and '$(TargetsWasm64)' == 'true'">420 <_WasmBatchMaximumMinutes Condition="'$(_WasmBatchMaximumMinutes)' == '' and '$(_IsOuterloopTestScope)' == 'true'">300 <_WasmBatchMaximumMinutes Condition="'$(_WasmBatchMaximumMinutes)' == ''">1439 From 803855ee336ebd9cfe368ce41d832c76f061a0bf Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Wed, 25 Nov 2026 11:00:56 -0600 Subject: [PATCH 8/8] Run large-memory browser tests locally, skip them only on CI Browser test apps don't inherit the host environment, so the wasm runner scripts now forward DOTNET_CI=true to the app on Helix. That lets [SkipOnCI] work in the browser and backs the new PlatformDetection.IsNotBrowserOnCI condition. The 64-bit-only multi-gigabyte tests that get OOM-killed in Helix containers on browser-wasm64 (ArrayBuffer.CanResizeToMaxArraySize, Double.ToString_ValidLargeFormat, the Utf8JsonWriter too-large tests, Base64/Base64Url EncodeTooLargeSpan and CreateReadOnlySpanFromNullTerminated_*_ExceedsMaximum) now skip only on browser CI instead of on every browser run. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/testing/WasmRunnerTemplate.cmd | 8 ++++++++ eng/testing/WasmRunnerTemplate.sh | 5 +++++ .../tests/TestUtilities/System/PlatformDetection.cs | 2 ++ .../Common/tests/Tests/System/Net/ArrayBufferTests.cs | 3 +-- .../System.Memory/tests/Base64/Base64EncoderUnitTests.cs | 2 +- .../tests/Base64Url/Base64UrlEncoderUnitTests.cs | 2 +- .../MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs | 4 ++-- .../tests/System.Runtime.Tests/System/DoubleTests.cs | 3 +-- .../tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs | 6 ++---- 9 files changed, 23 insertions(+), 12 deletions(-) diff --git a/eng/testing/WasmRunnerTemplate.cmd b/eng/testing/WasmRunnerTemplate.cmd index 463883384bde3d..4426ef79123b5b 100644 --- a/eng/testing/WasmRunnerTemplate.cmd +++ b/eng/testing/WasmRunnerTemplate.cmd @@ -80,6 +80,14 @@ if [%XUNIT_RANDOM_ORDER_SEED%] NEQ [] ( set "WasmXHarnessMonoArgs=%WasmXHarnessMonoArgs% --setenv=XUNIT_RANDOM_ORDER_SEED=%XUNIT_RANDOM_ORDER_SEED%" ) +:: The app doesn't inherit the host environment, so tell it when it runs in CI ([SkipOnCI], PlatformDetection.IsNotBrowserOnCI). +set "_IS_CI=" +if defined HELIX_WORKITEM_ROOT set "_IS_CI=1" +if defined DOTNET_CI set "_IS_CI=1" +if defined _IS_CI ( + set "WasmXHarnessMonoArgs=%WasmXHarnessMonoArgs% --setenv=DOTNET_CI=true" +) + echo EXECUTION_DIR=%EXECUTION_DIR% echo SCENARIO=%SCENARIO% echo XHARNESS_OUT=%XHARNESS_OUT% diff --git a/eng/testing/WasmRunnerTemplate.sh b/eng/testing/WasmRunnerTemplate.sh index 626c3c0ff80f39..51d2c09e50d0ee 100644 --- a/eng/testing/WasmRunnerTemplate.sh +++ b/eng/testing/WasmRunnerTemplate.sh @@ -76,6 +76,11 @@ if [[ -n "$XUNIT_RANDOM_ORDER_SEED" ]]; then WasmXHarnessMonoArgs="${WasmXHarnessMonoArgs} --setenv=XUNIT_RANDOM_ORDER_SEED=${XUNIT_RANDOM_ORDER_SEED}" fi +# The app doesn't inherit the host environment, so tell it when it runs in CI ([SkipOnCI], PlatformDetection.IsNotBrowserOnCI). +if [[ -n "$HELIX_WORKITEM_ROOT" || -n "$DOTNET_CI" ]]; then + WasmXHarnessMonoArgs="${WasmXHarnessMonoArgs} --setenv=DOTNET_CI=true" +fi + echo PATH=$PATH echo EXECUTION_DIR=$EXECUTION_DIR echo SCENARIO=$SCENARIO diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index c3a3ad9ffd6fca..2595f625ee8433 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -59,6 +59,8 @@ public static partial class PlatformDetection public static bool IsWasi => RuntimeInformation.IsOSPlatform(OSPlatform.Create("WASI")); public static bool IsWasm => IsBrowser || IsWasi; public static bool IsNotBrowser => !IsBrowser; + // Browser test runners forward DOTNET_CI to the app on CI; for tests that exhaust CI machine memory but can run locally. + public static bool IsNotBrowserOnCI => !IsBrowser || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_CI")); public static bool IsNotWasi => !IsWasi; public static bool IsMobile => IsBrowser || IsWasi || IsAppleMobile || IsAndroid; public static bool IsNotMobile => !IsMobile; diff --git a/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs b/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs index e13a5f70391bd1..ad6629d99c6373 100644 --- a/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs +++ b/src/libraries/Common/tests/Tests/System/Net/ArrayBufferTests.cs @@ -195,8 +195,7 @@ public void AddSeveralBytesRepeatedlyAndConsumeSeveralBytesRepeatedly_Success(bo } [OuterLoop] - [ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))] - [SkipOnPlatform(TestPlatforms.Browser, "Allocates multi-gigabyte buffers; wasm linear memory never shrinks, so the browser exhausts Helix machine memory")] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsNotBrowserOnCI))] [InlineData(true)] [InlineData(false)] public void CanResizeToMaxArraySize(bool usePool) diff --git a/src/libraries/System.Memory/tests/Base64/Base64EncoderUnitTests.cs b/src/libraries/System.Memory/tests/Base64/Base64EncoderUnitTests.cs index a4ba6c0b1176a4..d53fb347b9d3fb 100644 --- a/src/libraries/System.Memory/tests/Base64/Base64EncoderUnitTests.cs +++ b/src/libraries/System.Memory/tests/Base64/Base64EncoderUnitTests.cs @@ -195,7 +195,7 @@ public void EncodingOutputTooSmallRetry(bool isFinalBlock) Assert.True(Base64TestHelper.VerifyEncodingCorrectness(expectedConsumed, encodedBytes.Length, source, encodedBytes)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowserOnCI))] [InlineData(true)] [InlineData(false)] [OuterLoop] diff --git a/src/libraries/System.Memory/tests/Base64Url/Base64UrlEncoderUnitTests.cs b/src/libraries/System.Memory/tests/Base64Url/Base64UrlEncoderUnitTests.cs index bfabcc40d51b02..7dbec88ebdeac3 100644 --- a/src/libraries/System.Memory/tests/Base64Url/Base64UrlEncoderUnitTests.cs +++ b/src/libraries/System.Memory/tests/Base64Url/Base64UrlEncoderUnitTests.cs @@ -192,7 +192,7 @@ public void EncodingOutputTooSmallRetry(bool isFinalBlock) Assert.True(Base64TestHelper.VerifyUrlEncodingCorrectness(expectedConsumed, encodedBytes.Length, source, encodedBytes)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowserOnCI))] [InlineData(true)] [InlineData(false)] [OuterLoop] diff --git a/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs b/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs index d4f8d7977cba5a..6dad5a85fea5a9 100644 --- a/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs +++ b/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs @@ -62,7 +62,7 @@ public static unsafe void CreateReadOnlySpanFromNullTerminated_Byte(int expected } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsNotBrowserOnCI))] public static unsafe void CreateReadOnlySpanFromNullTerminated_Char_ExceedsMaximum() { char* mem; @@ -90,7 +90,7 @@ public static unsafe void CreateReadOnlySpanFromNullTerminated_Char_ExceedsMaxim } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsNotBrowserOnCI))] public static unsafe void CreateReadOnlySpanFromNullTerminated_Byte_ExceedsMaximum() { byte* mem; diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs index 5c7a70dd67b3b7..78ee3057e73342 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.cs @@ -1096,10 +1096,9 @@ public static void ToString_ExactPowerOfTwo_Roundtrips(ulong bits, string expect Assert.Equal(d, double.Parse(expected, CultureInfo.InvariantCulture)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))] // Requires a lot of memory + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsNotBrowserOnCI))] // Requires a lot of memory [OuterLoop("Takes a long time, allocates a lot of memory")] [SkipOnMono("Frequently throws OOM on Mono")] - [SkipOnPlatform(TestPlatforms.Browser, "Allocates multi-gigabyte buffers; wasm linear memory never shrinks, so the browser exhausts Helix machine memory")] public static void ToString_ValidLargeFormat() { double d = 123.0; diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs index 2b485021599afe..1e8dea24d215fc 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs @@ -3516,9 +3516,8 @@ public void WritingTooLargePropertyStandalone(JsonWriterOptions options) } } - [ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsNotBrowserOnCI))] [OuterLoop] - [SkipOnPlatform(TestPlatforms.Browser, "Allocates and fills multi-gigabyte buffers, which takes hours on the browser interpreter")] [MemberData(nameof(JsonOptions_TestData))] public void WritingTooLargeBase64Bytes(JsonWriterOptions options) { @@ -6977,9 +6976,8 @@ private static void WriteStringHelper(JsonEncodedText text, string expectedMessa } } - [ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsNotBrowserOnCI))] [OuterLoop] - [SkipOnPlatform(TestPlatforms.Browser, "Allocates and fills multi-gigabyte buffers, which takes hours on the browser interpreter")] [MemberData(nameof(JsonOptions_TestData))] public void WriteTooLargeArguments(JsonWriterOptions options) {