If the test process wont die, don't fail the build just ignore it and proceed#1215
If the test process wont die, don't fail the build just ignore it and proceed#1215LukeButters merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the NUKE build script to shut down the .NET build server at the end of a build in a way that won’t fail the build if shutdown fails/hangs.
Changes:
- Removed the
[ShutdownDotNetAfterServerBuild]attribute from the build entry point. - Added an
OnBuildFinished()override that runsdotnet build-server shutdownand ignores failures.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var process = Process.Start("dotnet", "build-server shutdown"); | ||
| process?.WaitForExit(10_000); | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| Log.Warning(e, "Failed to shut down dotnet build server — ignoring"); | ||
| } |
There was a problem hiding this comment.
Only exceptions are logged, but a non-zero exit code from dotnet build-server shutdown won’t throw and will currently be silently ignored. If you want to “ignore and proceed” while still preserving diagnostics, capture and log non-success exit codes (and possibly stdout/stderr) at Warning or Information level.
|
Will verify that the build servers are ephemeral, if they are not lets make them ephemeral then merge. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| using Serilog; | ||
| using static Nuke.Common.Tools.DotNet.DotNetTasks; | ||
|
|
||
| // macOS build agents are persistent (non-ephemeral), so compiler server processes may need to be cleaned up between builds. |
There was a problem hiding this comment.
Other agents are ephemeral so we wont need this on them.
Also we don't do this on octopus.
Background
Fixes: EFT-3259
AI summary:
The [ShutdownDotNetAfterServerBuildAttribute] runs dotnet build-server shutdown after every build. On the Windows 2012 build agent this process hangs, causing Nuke to throw an unhandled
exception and exit with code 255 — even when all tests pass.
macOS build agents are persistent (non-ephemeral) so the shutdown is still needed there to prevent compiler server processes accumulating between builds. Windows and Linux agents are
ephemeral so processes are cleaned up when the agent tears down.
Replaces the attribute with an OnBuildFinished override that calls DotNetBuildServerShutdown() on macOS only.
This should fix the issue seen at:
https://build.octopushq.com/buildConfiguration/TeamFireAndMotion_OctopusTentacle_TentacleVLatest_net80_IntegrationTestNet80onWindows2012net48service/22113648?buildTab=tests
where all the tests pass but we could not shutdown correctly.
Results
Fixes https://github.com/OctopusDeploy/OctopusTentacle/issues/... (optional public issue)
See How we use GitHub Issues (including this flowchart
Before
After
How to review this PR
Quality ✔️
Pre-requisites