Skip to content

Commit fd5428d

Browse files
[3.13] gh-120039: Reduce expected timeout in test_siginterrupt_off (GH-120047) (#120060)
The process is expected to time out. In the refleak builds, `support.SHORT_TIMEOUT` is often five minutes and we run the tests six times, so test_signal was taking >30 minutes. (cherry picked from commit d419d46) Co-authored-by: Sam Gross <[email protected]>
1 parent 8d74eae commit fd5428d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_signal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def handler(signum, frame):
698698
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
699699
class SiginterruptTest(unittest.TestCase):
700700

701-
def readpipe_interrupted(self, interrupt):
701+
def readpipe_interrupted(self, interrupt, timeout=support.SHORT_TIMEOUT):
702702
"""Perform a read during which a signal will arrive. Return True if the
703703
read is interrupted by the signal and raises an exception. Return False
704704
if it returns normally.
@@ -746,7 +746,7 @@ def handler(signum, frame):
746746
# wait until the child process is loaded and has started
747747
first_line = process.stdout.readline()
748748

749-
stdout, stderr = process.communicate(timeout=support.SHORT_TIMEOUT)
749+
stdout, stderr = process.communicate(timeout=timeout)
750750
except subprocess.TimeoutExpired:
751751
process.kill()
752752
return False
@@ -777,7 +777,7 @@ def test_siginterrupt_off(self):
777777
# If a signal handler is installed and siginterrupt is called with
778778
# a false value for the second argument, when that signal arrives, it
779779
# does not interrupt a syscall that's in progress.
780-
interrupted = self.readpipe_interrupted(False)
780+
interrupted = self.readpipe_interrupted(False, timeout=2)
781781
self.assertFalse(interrupted)
782782

783783

0 commit comments

Comments
 (0)