Skip to content

test(nix): fix Ctrl-C test sending the interrupt too early under DEVBOX_DEBUG - #3039

Merged
mikeland73 merged 1 commit into
mainfrom
mikeland73/cicd-broke-debug-fix
Nov 1, 2026
Merged

mikeland73 merged 1 commit into
mainfrom
mikeland73/cicd-broke-debug-fix

Conversation

@mikeland73

Copy link
Copy Markdown
Collaborator

Summary

Fixes the `cli-tests` failure on main (run 41329445252): `TestRunScriptWaitsForCommandOnCtrlC` (added in #3033) failed with `RunScript returned exit code 130`.

Cause: the test waits for `command: started` in the terminal output before sending Ctrl-C. CI runs with `DEVBOX_DEBUG=1`, so `RunScript` logs `executing script` with the script source, and that source contained `echo command: started`. The test matched the log line and sent Ctrl-C before `sh` had even set its INT trap, so the shell died from SIGINT (130) rather than running the trap and exiting 3. Locally, without debug logging, it passed.

Fix: print the marker with `printf 'command: %s\n' started` so the string no longer appears in the script source. This only changes the test.

Test plan

  • `DEVBOX_DEBUG=1 go test ./internal/nix -run TestRunScriptWaitsForCommandOnCtrlC`: failed 3/3 before, passes 5/5 after
  • Passes without `DEVBOX_DEBUG` (`-count=5`)

🤖 Generated with Claude Code

…OX_DEBUG

TestRunScriptWaitsForCommandOnCtrlC waited for "command: started" before
sending Ctrl-C. With DEVBOX_DEBUG=1 (set in CI), RunScript logs the script
source, which contained that string verbatim, so the test sent Ctrl-C before
the shell had installed its INT trap and the command exited with 130.

Print the marker with printf so it no longer appears in the script source.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mikeland73
mikeland73 merged commit 0fcc97b into main Nov 1, 2026
29 checks passed
@mikeland73
mikeland73 deleted the mikeland73/cicd-broke-debug-fix branch November 1, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant