@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.
# 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
# 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)