Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property s_buildEnv.IsMonoRuntime does not exist. The correct way to check the runtime flavor is to use EnvironmentVariables.RuntimeFlavor != "CoreCLR" (as seen in BuildEnvironment.cs line 114 and WasmTemplateTestsBase.cs line 127). Alternatively, consider adding a public property IsMonoRuntime to BuildEnvironment class that returns EnvironmentVariables.RuntimeFlavor != "CoreCLR" for better consistency and readability.

Suggested change
{"runtimeFlavor", s_buildEnv.IsMonoRuntime ? "Mono" : "CoreCLR" }
{"runtimeFlavor", EnvironmentVariables.RuntimeFlavor != "CoreCLR" ? "Mono" : "CoreCLR" }

Copilot uses AI. Check for mistakes.
}
Comment on lines +34 to +37
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description lists removing the webcil10 exemption from throttling in src/native/libs/Common/JavaScript/loader/assets.ts (the noThrottleNoRetry map), but in the current code that entry still appears to be present. If that change was intentionally deferred (e.g., due to Webcil loader concerns), please update the PR description accordingly; otherwise include the intended code change so the description matches what this PR actually does.

Copilot uses AI. Check for mistakes.
));

var resultTestOutput = result.TestOutput.ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the changes are described in the PR, this is point 3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I think we do not use import() for .wasm files.

if (url.includes("dotnet.native")) {
return originalFetch2(...args);
}
}
activeFetchCount++;
testOutput(`Fetch started. Active downloads: ${activeFetchCount}`);
try {
Expand All @@ -143,7 +150,7 @@ switch (testCase) {
throw error;
}
};
dotnet.withConfig({ maxParallelDownloads: maxParallelDownloads });
dotnet.withConfig({ maxParallelDownloads: parseInt(maxParallelDownloads) });
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parseInt call should include a radix parameter (10) and handle potential NaN results. If maxParallelDownloads is null/undefined/invalid, parseInt returns NaN, which could cause unexpected behavior in the runtime throttling logic. Consider adding validation or using parseInt(maxParallelDownloads, 10) || 16 to provide a fallback to the default value.

Suggested change
dotnet.withConfig({ maxParallelDownloads: parseInt(maxParallelDownloads) });
dotnet.withConfig({ maxParallelDownloads: parseInt(maxParallelDownloads, 10) || 16 });

Copilot uses AI. Check for mistakes.
break;
case "AllocateLargeHeapThenInterop":
dotnet.withEnvironmentVariable("MONO_LOG_LEVEL", "debug")
Expand Down
Loading