10000 gh-120039: Reduce expected timeout in test_siginterrupt_off by colesbury · Pull Request #120047 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120039: Reduce expected timeout in test_siginterrupt_off #120047

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

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address code review
  • Loading branch information
colesbury committed Jun 4, 2024
commit d86a3bbcff8f293e720a533ae64a6d7945e920b1
8 changes: 4 additions & 4 deletions Lib/test/test_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def handler(signum, frame):
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
class SiginterruptTest(unittest.TestCase):

def readpipe_interrupted(self, interrupt, timeout):
def readpipe_interrupted(self, interrupt, timeout=support.SHORT_TIMEOUT):
"""Perform a read during which a signal will arrive. Return True if the
read is interrupted by the signal and raises an exception. Return False
if it returns normally.
Expand Down Expand Up @@ -762,22 +762,22 @@ def test_without_siginterrupt(self):
# If a signal handler is installed and siginterrupt is not called
# at all, when that signal arrives, it interrupts a syscall that's in
# progress.
interrupted = self.readpipe_interrupted(None, support.SHORT_TIMEOUT)
interrupted = self.readpipe_interrupted(None)
self.assertTrue(interrupted)

def test_siginterrupt_on(self):
# If a signal handler is installed and siginterrupt is called with
# a true value for the second argument, when that signal arrives, it
# interrupts a syscall that's in progress.
interrupted = self.readpipe_interrupted(True, support.SHORT_TIMEOUT)
interrupted = self.readpipe_interrupted(True)
self.assertTrue(interrupted)

@support.requires_resource('walltime')
def test_siginterrupt_off(self):
# If a signal handler is installed and siginterrupt is called with
# a false value for the second argument, when that signal arrives, it
# does not interrupt a syscall that's in progress.
interrupted = self.readpipe_interrupted(False, 2)
interrupted = self.readpipe_interrupted(False, timeout=2)
self.assertFalse(interrupted)


Expand Down
0