Commit 19e5bcdd authored by Victor Stinner's avatar Victor Stinner

(merge 3.2) Issue #12363: increase the timeout of siginterrupt() tests

Move also the "ready" trigger after the installation of the signal handler and
the call to siginterrupt().

Use a timeout of 5 seconds instead of 3. Two seconds are supposed to be enough,
but some of our buildbots are really slow (especially the FreeBSD 6 VM).
parents 77c7218e dfde0d46
...@@ -358,13 +358,13 @@ class SiginterruptTest(unittest.TestCase): ...@@ -358,13 +358,13 @@ class SiginterruptTest(unittest.TestCase):
def handler(signum, frame): def handler(signum, frame):
pass pass
print("ready")
sys.stdout.flush()
signal.signal(signal.SIGALRM, handler) signal.signal(signal.SIGALRM, handler)
if interrupt is not None: if interrupt is not None:
signal.siginterrupt(signal.SIGALRM, interrupt) signal.siginterrupt(signal.SIGALRM, interrupt)
print("ready")
sys.stdout.flush()
# run the test twice # run the test twice
for loop in range(2): for loop in range(2):
# send a SIGALRM in a second (during the read) # send a SIGALRM in a second (during the read)
...@@ -384,7 +384,7 @@ class SiginterruptTest(unittest.TestCase): ...@@ -384,7 +384,7 @@ class SiginterruptTest(unittest.TestCase):
# wait until the child process is loaded and has started # wait until the child process is loaded and has started
first_line = process.stdout.readline() first_line = process.stdout.readline()
stdout, stderr = process.communicate(timeout=3.0) stdout, stderr = process.communicate(timeout=5.0)
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
process.kill() process.kill()
return False return False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment