Repository navigation
fix(tests): disable MSBuild node reuse for spawned builds - #2
Merged
Merged
Conversation
The ref project build tests and the package layout fixture spawn `dotnet build`/`dotnet pack` with redirected stdout/stderr. MSBuild worker nodes started with node reuse outlive the build and inherit those pipes, so reading the streams to the end blocked until the nodes hit their idle timeout. Set MSBUILDDISABLENODEREUSE=1 for the spawned processes and drain stderr concurrently in PackageLayoutFixture to avoid a full-pipe deadlock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Coverage workflow runs the tests in the mcr.microsoft.com/dotnet/sdk:10.0
image, which only ships the .NET 10 runtime. The net8.0 test host could not
start there ("You must install or update .NET to run this application").
Keep net8.0 as the test target framework and set RollForward=Major so the
tests run on the newest installed runtime.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
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.
Problem
RefProjectBuildTestsandPackageLayoutFixturespawndotnet build/dotnet packwith redirected stdout/stderr and read both streams to the end. MSBuild worker nodes started withnodeReuse:trueoutlive the build and inherit those pipes, so EOF never arrives until the orphaned nodes hit their idle timeout.Locally this made
dotnet testhang indefinitely (verified withlsof: the orphaned node, re-parented to PID 1, held the write ends of the pipes the testhost was reading). It most likely also explains why the Coverage workflow went from ~1 min to ~31 min per run starting with the push on 2026-02-15 (the old job logs have expired, so this part is inferred, not proven).Separately, the Coverage workflow currently fails before any test runs: the
mcr.microsoft.com/dotnet/sdk:10.0image only ships the .NET 10 runtime, so thenet8.0test host cannot start ("You must install or update .NET to run this application").Fix
MSBUILDDISABLENODEREUSE=1on the spawned processes in both helpers.PackageLayoutFixture, drain stderr concurrently instead of after stdout, avoiding a deadlock when the stderr pipe buffer fills up.RollForward=Majorin the test project so thenet8.0tests run on the newest installed runtime. The test target framework staysnet8.0; the shipped generator (netstandard2.0) is unaffected.Verification
From a clean state (
dotnet build-server shutdown, ref projectbin/+obj/removed), without setting the variable externally:nodeReuse:trueMSBuild node was present again.With only the .NET 10 runtime installed (same situation as the CI image), the CI test command (
dotnet test --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=TestResults/coverage/) passes 107/107 without any environment overrides and writescoverage.cobertura.xml.🤖 Generated with Claude Code