Repository navigation
fix(tests): restore SIGINT handler in keyboard-interrupt fill child - #3241
Conversation
Background non-interactive shells inherit SIGINT as SIG_IGN, so the re-armed interrupt from a fill never becomes KeyboardInterrupt. Fixes NVIDIA#3213
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Child signal setup cuda_core/tests/test_driver_table.py |
The child installs signal.default_int_handler for SIGINT before the NVRTC fill test. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Ensure the interrupt test passes when the parent process inherits ignored SIGINT [#3213] |
✅ |
Suggested labels: test, bug, cuda.core
Suggested reviewers: andy-jost
Priority:
Change: Bug fix · Severity of issue fixed: Low
Merge Risk: 
Minimal · previous review cefc3
-
The test-only signal-handling fix is ready to merge.
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
/ok to test 7fb966d |
|
|
Thanks for the PR, @mangeshraut712. One process note: CONTRIBUTING.md asks contributors to comment on the issue and wait to be assigned by a maintainer before starting work. #3213 has no assignee and no comment from you, and its author (@0z5a) had already offered to open the PR in the issue description. To avoid duplicated effort, could you please comment on #3213 for next time, and could the maintainers confirm how to proceed here (@0z5a, are you still planning to open your own PR?). For what it's worth, the fix itself looks consistent with what the issue proposes. |
Since the author seems not having a GPU to validate, I am willing to open a PR to fix the issue under the reported environment soon. Thanks! |
Andy-Jost
left a comment
There was a problem hiding this comment.
Thanks, this is the right fix, and it is the cause rather than a symptom. When pytest runs as a background job of a non-interactive shell, the child inherits SIGINT as ignored, and CPython's PyErr_SetInterrupt() trips nothing when the Python-level handler is SIG_IGN; the fill's re-arm therefore never reached the child, which is the NOT INTERRUPTED of #3213. Installing default_int_handler restores the path. I reproduced the failure with the current test as a background job, and the pass with the change, six of six runs; in the foreground both pass. The test still discriminates: a library that dropped the re-arm fails the same way as before. On Windows the call is a valid no-op for a subprocess.run child, and the test passed on the Windows and WSL rows.
The one red test job on the first CI attempt, Python 3.14t on the A100 MCDM runner, died in test_incremental_ltoir_round_trip with an access violation, which is the open #3038 pattern and unrelated to this change; it is re-running.
Credit: #3213's author proposed this exact line and offered to open the PR. The squash commit should carry a Co-authored-by trailer for @0z5a.
|
Thanks @lijinf2 and @0z5a. The change here is the exact line proposed in #3213, and it has been validated on a GPU host: the failure reproduces with the current test when pytest runs as a background job of a non-interactive shell, and the fix passes six of six runs there, besides the Windows and WSL CI rows. So a second PR is not needed; the squash commit credits @0z5a as co-author. @mangeshraut712, for next time please comment on the issue and wait for an assignment before opening a PR, as CONTRIBUTING asks, so two people do not work the same fix. |
|
Thanks @Andy-Jost for validating on a GPU host and for the clarification. Sounds good: no second PR needed. Thanks also to @mangeshraut712 for the fix and @0z5a for the original proposal. |
Description
test_keyboard_interrupt_during_a_fill_reaches_the_userfails when pytest is started as a background job of a non-interactive shell, because that environment inheritsSIGINTasSIG_IGN. Python does not install aKeyboardInterrupthandler in that case, andPyErr_SetInterruptExis a no-op for an ignored signal, so the fill's re-armed interrupt never reaches the child.Restore
signal.default_int_handlerat the start of_INTERRUPTED_CHILDso the test does not depend on how the runner was started.Issue
Fixes #3213
Checklist