Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_recovery_sigint: Ensure precondition is met #829

Merged
merged 2 commits into from
Jan 1, 2024

Conversation

sorah
Copy link
Member

@sorah sorah commented Dec 31, 2023

  1. Ensure precondition is met on test_recovery_sigint. It depends on its process has SIG_DFL sigaction for SIGINT. When its parent process set SIG_IGN which inherits to children, then this test fails. This patch ensures this precondition met regardless of inherited sigaction from its parent.
  2. Add another variant of test_recovery_sigint to ensure IRB to preserve existing SIGINT handler other than SIG_DFL.

My build process had unintentionally had SIG_IGN for SIGINT so this test started to fail, and took time to understand the cause. But in general it'd be better to ensure precondition in each test case, so sending this patch with additional scenario.

sorah added 2 commits January 1, 2024 06:14
test_recovery_sigint depends on its process has SIG_DEF sigaction for
SIGINT. When its parent process set SIG_IGN which inherits to children,
then this test fails. This patch ensures this precondition met
regardless of inherited sigaction from its parent.
Add another variant of test_recovery_sigint to ensure IRB to preserve
existing SIGINT handler other than SIG_DEF.
@sorah sorah requested a review from a team December 31, 2023 21:23
Copy link
Member

@tompng tompng left a comment

Choose a reason for hiding this comment

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

👍

@tompng tompng merged commit 77ee59d into ruby:master Jan 1, 2024
28 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Jan 1, 2024
(ruby/irb#829)

* test_recovery_sigint: Ensure precondition is met

test_recovery_sigint depends on its process has SIG_DEF sigaction for
SIGINT. When its parent process set SIG_IGN which inherits to children,
then this test fails. This patch ensures this precondition met
regardless of inherited sigaction from its parent.

* Add test for restoration of other SIGINT handlers

Add another variant of test_recovery_sigint to ensure IRB to preserve
existing SIGINT handler other than SIG_DEF.

ruby/irb@77ee59d026
@sorah sorah deleted the sigint-test2 branch January 1, 2024 11:36
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.

2 participants