Skip to content

test_recovery_sigint: Ensure precondition is met - #829

Merged
tompng merged 2 commits into
ruby:masterfrom
sorah:sigint-test2
Jan 1, 2024
Merged

tompng merged 2 commits into
ruby:masterfrom
sorah:sigint-test2

Conversation

@sorah

@sorah sorah commented Dec 31, 2023 •

Copy link
Copy Markdown
Member
  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

@tompng tompng left a comment

Copy link
Copy Markdown
Member

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants