Repository navigation
[wasm] Use BuildProjectWithoutAssert (-nr:false) in MultiClientHostedBuildAndPublish - #137368
Merged
Merged
Conversation
Every other Wasm.Build.Tests build goes through BuildProjectWithoutAssert, which passes -nr:false. This test invokes dotnet build/publish directly without it, so reusable MSBuild nodes may outlive the build and keep the server output locked during fixture cleanup. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Route the build/publish through the shared helper so the test picks up -nr:false and the binlog output fallback from one place. Co-authored-by: Copilot App <[email protected]>
akoeplinger
approved these changes
Nov 11, 2026
lewing
enabled auto-merge (squash)
November 11, 2026 18:03
Member
Author
|
/ba-g failure is known |
lewing
added a commit
that referenced
this pull request
Nov 12, 2026
…#137370) `BuildTestBase.BuildProjectWithoutAssert` tried to add `-p:WasmBuildOnlyAfterPublish=true` with LINQ `Enumerable.Append` on a `List<string>`. That returns a new sequence, which was discarded, so the flag hasn't been passed since #89360 switched the command line from a `StringBuilder`. The flag is also redundant: `dotnet publish` sets `_IsPublishing=true`, and `WasmApp.Common.targets` and `BrowserWasmApp.CoreCLR.targets` already default `WasmBuildOnlyAfterPublish` to `true` in that case. This PR removes the dead branch and the unused `PublishOptions.BuildOnlyAfterPublish` option, so test behavior is unchanged. `commandLineArgs.AddRange(buildOptions.ExtraMSBuildArgs)` (a `string`) is left as is. It binds to `AddRange(List<T>, params ReadOnlySpan<T>)` as one element, and `DotNetCommand` joins the args with spaces, so values with several arguments still pass correctly. Related: #137368, which switched `MultiClientHostedBuildAndPublish` to `BuildProjectWithoutAssert` and surfaced this dead code. Validation: `Wasm.Build.Tests.csproj` compiled with no errors. Wasm.Build.Tests were not run locally. > [!NOTE] > This PR description was generated with assistance from GitHub Copilot. Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MiscTests.MultiClientHostedBuildAndPublishcalleddotnet build/publishdirectly throughDotNetCommand.ExecuteWithCapturedOutput, without-nr:false. Every other Wasm.Build.Tests build goes throughBuildTestBase.BuildProjectWithoutAssert, which always passes-nr:false.This PR switches the test to
BuildProjectWithoutAssertwithBuildOptionsorPublishOptions, so it gets-nr:false(and the helper's binlog output fallback) from the same place as the rest of the suite. For this test, the command line is otherwise unchanged: it runs in the same directory (_projectDir) with the sameNUGET_PACKAGES,-p:Configuration, and-bl. The helper'sWBTOverrideRuntimePackpath doesn't apply, becauseUseWBTOverridePackTargetsis never set to true. The binlog file name changes to the helper's convention.Why
Over the last 30 days (AzureDevOpsTests), this is the only Wasm.Build.Tests test that fails with:
The failure appeared in 16 Windows
mainbuilds, most recently Nov 11. The stack isSharedBuildPerTestClassFixture.RemoveDirectory<-RemoveFromCache<-BuildTestBase.Dispose, so the build itself succeeds and test cleanup fails.Hypothesis (not proven): Without
-nr:false, the build leaves reusable MSBuild worker nodes running, and they keep the server's output locked, so cleanup can't delete the directory. Related: #137297 added a ~9 s cleanup retry and waits for killedToolCommandprocesses to exit. The wait doesn't apply here, because this test never starts a long-running process, and idle MSBuild nodes can outlive the retry window. If this test still fails the same way after this change, the hypothesis is wrong.Related cleanup
While doing this, we found that
BuildProjectWithoutAssertdiscards the result of LINQAppendwhen it tries to add-p:WasmBuildOnlyAfterPublish=true, soPublishOptions.BuildOnlyAfterPublishnever took effect. That's harmless:dotnet publishalready defaultsWasmBuildOnlyAfterPublish=true. #137370 removes the dead code separately.Validation
Not built or run locally. I skipped the SDK bootstrap and Wasm.Build.Tests dependency build to save disk space. CI will compile it and run the test.
Note
This PR description and change were generated with GitHub Copilot.