Repository navigation
test(nix): fix Ctrl-C test sending the interrupt too early under DEVBOX_DEBUG - #3039
Merged
Merged
Conversation
…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>
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.
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
🤖 Generated with Claude Code