Skip to content

Commit c8c23aa

Browse files
[3.12] gh-120039: Reduce expected timeout in test_siginterrupt_off (GH-120047) (#120061)
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 f98ec75 commit c8c23aa

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
@@ -697,7 +697,7 @@ def handler(signum, frame):
697697
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
698698
class SiginterruptTest(unittest.TestCase):
699699

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

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

782782

0 commit comments

Comments
 (0)