Repository navigation
[wasm] Remove dead BuildOnlyAfterPublish option from Wasm.Build.Tests - #137370
Merged
Merged
Conversation
BuildProjectWithoutAssert appended -p:WasmBuildOnlyAfterPublish=true via LINQ Enumerable.Append on a List<string>, discarding the result, so the flag has not been passed since #89360. It is also redundant: publish runs with _IsPublishing=true, and WasmApp.Common.targets and BrowserWasmApp.CoreCLR.targets already default WasmBuildOnlyAfterPublish to true in that case. Remove the branch and the unused PublishOptions.BuildOnlyAfterPublish option. 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. |
lewing
added a commit
that referenced
this pull request
Nov 11, 2026
…BuildAndPublish (#137368) `MiscTests.MultiClientHostedBuildAndPublish` called `dotnet build`/`publish` directly through `DotNetCommand.ExecuteWithCapturedOutput`, without `-nr:false`. Every other Wasm.Build.Tests build goes through `BuildTestBase.BuildProjectWithoutAssert`, which always passes `-nr:false`. This PR switches the test to `BuildProjectWithoutAssert` with `BuildOptions` or `PublishOptions`, 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 same `NUGET_PACKAGES`, `-p:Configuration`, and `-bl`. The helper's `WBTOverrideRuntimePack` path doesn't apply, because `UseWBTOverridePackTargets` is 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: ``` System.UnauthorizedAccessException: Access to the path 'BlazorMultiClientHosted.dll' (or '.exe') is denied ``` The failure appeared in 16 Windows `main` builds, most recently Nov 11. The stack is `SharedBuildPerTestClassFixture.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 killed `ToolCommand` processes 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 `BuildProjectWithoutAssert` discards the result of LINQ `Append` when it tries to add `-p:WasmBuildOnlyAfterPublish=true`, so `PublishOptions.BuildOnlyAfterPublish` never took effect. That's harmless: `dotnet publish` already defaults `WasmBuildOnlyAfterPublish=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. --------- Co-authored-by: Copilot App <[email protected]>
maraf
approved these changes
Nov 12, 2026
lewing
enabled auto-merge (squash)
November 12, 2026 17:10
Member
Author
|
/ba-g failure is wbt timeout |
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.
BuildTestBase.BuildProjectWithoutAsserttried to add-p:WasmBuildOnlyAfterPublish=truewith LINQEnumerable.Appendon aList<string>. That returns a new sequence, which was discarded, so the flag hasn't been passed since #89360 switched the command line from aStringBuilder. The flag is also redundant:dotnet publishsets_IsPublishing=true, andWasmApp.Common.targetsandBrowserWasmApp.CoreCLR.targetsalready defaultWasmBuildOnlyAfterPublishtotruein that case. This PR removes the dead branch and the unusedPublishOptions.BuildOnlyAfterPublishoption, so test behavior is unchanged.commandLineArgs.AddRange(buildOptions.ExtraMSBuildArgs)(astring) is left as is. It binds toAddRange(List<T>, params ReadOnlySpan<T>)as one element, andDotNetCommandjoins the args with spaces, so values with several arguments still pass correctly.Related: #137368, which switched
MultiClientHostedBuildAndPublishtoBuildProjectWithoutAssertand surfaced this dead code.Validation:
Wasm.Build.Tests.csprojcompiled with no errors. Wasm.Build.Tests were not run locally.Note
This PR description was generated with assistance from GitHub Copilot.