diff options
author | Heng Liu <liucougar@gmail.com> | 2011-11-04 13:45:33 -0700 |
---|---|---|
committer | Heng Liu <liucougar@gmail.com> | 2011-11-04 13:45:33 -0700 |
commit | 0f3ff413655950a3de8507f41575aec025e4b234 (patch) | |
tree | db7c459e75d4043e96be147eb622713b96a5af03 /functional_tests | |
parent | 8618a9498479c7949aef427d9a5a03b3b60abd85 (diff) | |
download | nose-0f3ff413655950a3de8507f41575aec025e4b234.tar.gz |
make test_keyboardinterrupt multiprocess plugin test more robust on slow
machines (like the CI server)
Diffstat (limited to 'functional_tests')
-rw-r--r-- | functional_tests/test_multiprocessing/test_keyboardinterrupt.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/functional_tests/test_multiprocessing/test_keyboardinterrupt.py b/functional_tests/test_multiprocessing/test_keyboardinterrupt.py index 296bd19..8f07e54 100644 --- a/functional_tests/test_multiprocessing/test_keyboardinterrupt.py +++ b/functional_tests/test_multiprocessing/test_keyboardinterrupt.py @@ -29,7 +29,13 @@ def keyboardinterrupt(case): logfile = mktemp() process = Popen([sys.executable,runner,os.path.join(support,case),logfile], preexec_fn=os.setsid, stdout=PIPE, stderr=PIPE, bufsize=-1) - sleep(1) + #wait until logfile is created: + retry=100 + while not os.path.exists(logfile): + sleep(0.1) + retry -= 1 + if not retry: + raise Exception('Timeout while waiting for log file to be created by fake_nosetest.py') os.killpg(process.pid, signal.SIGINT) return process, logfile |