]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120039: Reduce expected timeout in test_siginterrupt_off (#120047)
authorSam Gross <colesbury@gmail.com>
Tue, 4 Jun 2024 17:38:29 +0000 (13:38 -0400)
committerGitHub <noreply@github.com>
Tue, 4 Jun 2024 17:38:29 +0000 (17:38 +0000)
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.

Lib/test/test_signal.py

index 61fb047caf6dab6c66a446cf880921b9a039bb0d..591cd4177d9f41bb84fc992fd3777b137201ef69 100644 (file)
@@ -698,7 +698,7 @@ class WakeupSocketSignalTests(unittest.TestCase):
 @unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
 class SiginterruptTest(unittest.TestCase):
 
-    def readpipe_interrupted(self, interrupt):
+    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.
@@ -746,7 +746,7 @@ class SiginterruptTest(unittest.TestCase):
                 # wait until the child process is loaded and has started
                 first_line = process.stdout.readline()
 
-                stdout, stderr = process.communicate(timeout=support.SHORT_TIMEOUT)
+                stdout, stderr = process.communicate(timeout=timeout)
             except subprocess.TimeoutExpired:
                 process.kill()
                 return False
@@ -777,7 +777,7 @@ class SiginterruptTest(unittest.TestCase):
         # 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)
+        interrupted = self.readpipe_interrupted(False, timeout=2)
         self.assertFalse(interrupted)