Skip to content

fix(tests): restore SIGINT handler in keyboard-interrupt fill child - #3241

Merged
Andy-Jost merged 2 commits into
NVIDIA:mainfrom
mangeshraut712:tip/3213-keyboard-interrupt-sigint
Oct 28, 2026
Merged

Andy-Jost merged 2 commits into
NVIDIA:mainfrom
mangeshraut712:tip/3213-keyboard-interrupt-sigint

Conversation

@mangeshraut712

Copy link
Copy Markdown
Contributor

Description

test_keyboard_interrupt_during_a_fill_reaches_the_user fails when pytest is started as a background job of a non-interactive shell, because that environment inherits SIGINT as SIG_IGN. Python does not install a KeyboardInterrupt handler in that case, and PyErr_SetInterruptEx is a no-op for an ignored signal, so the fill's re-armed interrupt never reaches the child.

Restore signal.default_int_handler at the start of _INTERRUPTED_CHILD so the test does not depend on how the runner was started.

Issue

Fixes #3213

Checklist

  • I am familiar with the Contribution Guidelines.
  • New code tests are included with new features or high-risk changes.

Background non-interactive shells inherit SIGINT as SIG_IGN, so the
re-armed interrupt from a fill never becomes KeyboardInterrupt.

Fixes NVIDIA#3213
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-27T10:29:17.119097Z
We couldn’t complete this review. Comment @codex review to try again.
cefc364 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between cefc364 and 7fb966d.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 590a8bf and cefc364.

Files selected for processing: 1
  • cuda_core/tests/test_driver_table.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Tests
    • Improved interrupt-test behavior to ensure keyboard interrupts reach the test process reliably.

The interrupt-test child now sets SIGINT to Python’s default handler before exercising the NVRTC function-table fill.

Changes: Interrupt test

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: Low

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.

@Andy-Jost

Copy link
Copy Markdown
Contributor

/ok to test 7fb966d

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

@Andy-Jost Andy-Jost self-assigned this Oct 28, 2026
@Andy-Jost Andy-Jost added bug Something isn't working P2 Low priority - Nice to have labels Oct 28, 2026
@Andy-Jost Andy-Jost added this to the cuda.core 1.3.0 milestone Oct 28, 2026
@lijinf2

lijinf2 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

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.

@0z5a

0z5a commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

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 Andy-Jost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@Andy-Jost
Andy-Jost merged commit d649075 into NVIDIA:main Oct 28, 2026
222 of 226 checks passed
@Andy-Jost

Copy link
Copy Markdown
Contributor

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.

@lijinf2

lijinf2 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

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.

github-actions Bot pushed a commit that referenced this pull request Oct 29, 2026
Removed preview folders for the following PRs:
- PR #3103
- PR #3170
- PR #3224
- PR #3241
- PR #3250
- PR #3263
- PR #3264
- PR #3270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.core Everything related to the cuda.core module P2 Low priority - Nice to have

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: test_keyboard_interrupt_during_a_fill_reaches_the_user fails when the test process inherits SIGINT as ignored

4 participants