From 3c0f6f5d50bee4a693a21d7df4aa9a6ead478102 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Fri, 27 Feb 2026 13:35:39 +0100 Subject: [PATCH 1/3] Apply fix. --- .../wasm/Wasm.Build.Tests/MaxParallelDownloadsTests.cs | 5 ++++- .../wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js | 9 ++++++++- src/native/libs/Common/JavaScript/loader/assets.ts | 1 - 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/MaxParallelDownloadsTests.cs b/src/mono/wasm/Wasm.Build.Tests/MaxParallelDownloadsTests.cs index 5c7c13c9b7db2a..4a75a660ebbf7b 100644 --- a/src/mono/wasm/Wasm.Build.Tests/MaxParallelDownloadsTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/MaxParallelDownloadsTests.cs @@ -31,7 +31,10 @@ public async Task NeverFetchMoreThanMaxAllowed(Configuration config, string maxP RunResult result = await RunForBuildWithDotnetRun(new BrowserRunOptions( config, TestScenario: "MaxParallelDownloads", - BrowserQueryString: new NameValueCollection { {"maxParallelDownloads", maxParallelDownloads } } + BrowserQueryString: new NameValueCollection { + {"maxParallelDownloads", maxParallelDownloads }, + {"runtimeFlavor", s_buildEnv.IsMonoRuntime ? "Mono" : "CoreCLR" } + } )); var resultTestOutput = result.TestOutput.ToList(); diff --git a/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js b/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js index d50d7066655cd5..a2a4fbfb81c0e0 100644 --- a/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js +++ b/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js @@ -129,7 +129,14 @@ switch (testCase) { const maxParallelDownloads = params.get("maxParallelDownloads"); let activeFetchCount = 0; const originalFetch2 = globalThis.fetch; + const isCoreCLR = params.get("runtimeFlavor") === "CoreCLR"; globalThis.fetch = async (...args) => { + if (isCoreCLR) { + const url = typeof args[0] === "string" ? args[0] : args[0]?.url ?? ""; + if (url.includes("dotnet.native")) { + return originalFetch2(...args); + } + } activeFetchCount++; testOutput(`Fetch started. Active downloads: ${activeFetchCount}`); try { @@ -143,7 +150,7 @@ switch (testCase) { throw error; } }; - dotnet.withConfig({ maxParallelDownloads: maxParallelDownloads }); + dotnet.withConfig({ maxParallelDownloads: parseInt(maxParallelDownloads) }); break; case "AllocateLargeHeapThenInterop": dotnet.withEnvironmentVariable("MONO_LOG_LEVEL", "debug") diff --git a/src/native/libs/Common/JavaScript/loader/assets.ts b/src/native/libs/Common/JavaScript/loader/assets.ts index 8ec3a80e7a6708..f4b43af7b2b4c0 100644 --- a/src/native/libs/Common/JavaScript/loader/assets.ts +++ b/src/native/libs/Common/JavaScript/loader/assets.ts @@ -463,5 +463,4 @@ const behaviorToContentTypeMap: { [key: string]: string | undefined } = { const noThrottleNoRetry: { [key: string]: number | undefined } = { "dotnetwasm": 1, "symbols": 1, - "webcil10": 1, }; From 14297857c9f58603dcf9c07985f3db9cff1a5890 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Mon, 2 Mar 2026 09:58:42 +0100 Subject: [PATCH 2/3] Tests pass without changing `noThrottleNoRetry`. --- src/native/libs/Common/JavaScript/loader/assets.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/native/libs/Common/JavaScript/loader/assets.ts b/src/native/libs/Common/JavaScript/loader/assets.ts index f4b43af7b2b4c0..8ec3a80e7a6708 100644 --- a/src/native/libs/Common/JavaScript/loader/assets.ts +++ b/src/native/libs/Common/JavaScript/loader/assets.ts @@ -463,4 +463,5 @@ const behaviorToContentTypeMap: { [key: string]: string | undefined } = { const noThrottleNoRetry: { [key: string]: number | undefined } = { "dotnetwasm": 1, "symbols": 1, + "webcil10": 1, }; From c2304702b3b226a1b256f5b28758d7483fa47fc8 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Mon, 2 Mar 2026 10:14:28 +0100 Subject: [PATCH 3/3] Enable on CI. --- eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt b/eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt index 28a2f6ccee94a4..1c6ca2e9b8a3c4 100644 --- a/eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt +++ b/eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt @@ -3,6 +3,7 @@ Wasm.Build.Tests.EnvVariablesTests Wasm.Build.Tests.FilesToIncludeInFileSystemTests Wasm.Build.Tests.HttpTests Wasm.Build.Tests.LazyLoadingTests +Wasm.Build.Tests.MaxParallelDownloadsTests Wasm.Build.Tests.ModuleConfigTests Wasm.Build.Tests.PreloadingTests Wasm.Build.Tests.RebuildTests