-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[coreclr] Throttling of parallel downloads is supported #124964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" } | ||
| } | ||
|
Comment on lines
+34
to
+37
|
||
| )); | ||
|
|
||
| var resultTestOutput = result.TestOutput.ToList(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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 ?? ""; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please explain ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the changes are described in the PR, this is point 3.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I think we do not use |
||||||
| 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) }); | ||||||
|
||||||
| dotnet.withConfig({ maxParallelDownloads: parseInt(maxParallelDownloads) }); | |
| dotnet.withConfig({ maxParallelDownloads: parseInt(maxParallelDownloads, 10) || 16 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property
s_buildEnv.IsMonoRuntimedoes not exist. The correct way to check the runtime flavor is to useEnvironmentVariables.RuntimeFlavor != "CoreCLR"(as seen in BuildEnvironment.cs line 114 and WasmTemplateTestsBase.cs line 127). Alternatively, consider adding a public propertyIsMonoRuntimeto BuildEnvironment class that returnsEnvironmentVariables.RuntimeFlavor != "CoreCLR"for better consistency and readability.