Skip to content

If the test process wont die, don't fail the build just ignore it and proceed#1215

Merged
LukeButters merged 5 commits intomainfrom
luke/dont-fail-on-unkillable-builds
May 1, 2026
Merged

If the test process wont die, don't fail the build just ignore it and proceed#1215
LukeButters merged 5 commits intomainfrom
luke/dont-fail-on-unkillable-builds

Conversation

@LukeButters
Copy link
Copy Markdown
Contributor

@LukeButters LukeButters commented Apr 30, 2026

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

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 runs dotnet build-server shutdown and ignores failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build/Build.cs Outdated
Comment on lines +332 to +338
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");
}
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread build/Build.cs Outdated
Comment thread build/Build.cs Outdated
@LukeButters
Copy link
Copy Markdown
Contributor Author

Will verify that the build servers are ephemeral, if they are not lets make them ephemeral then merge.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread build/Build.cs
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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other agents are ephemeral so we wont need this on them.

Also we don't do this on octopus.

@LukeButters LukeButters merged commit 1b8e5eb into main May 1, 2026
51 checks passed
@LukeButters LukeButters deleted the luke/dont-fail-on-unkillable-builds branch May 1, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants