Commit b7dd309e authored by Brandon Carpenter's avatar Brandon Carpenter

Recommended fixes to tests for #561 and #571. See PR #578.

parent fb1ea5f0
...@@ -30,13 +30,19 @@ else: ...@@ -30,13 +30,19 @@ else:
else: else:
kwargs = {} kwargs = {}
p = Popen([sys.executable, __file__, 'subprocess'], stdout=PIPE, **kwargs) p = Popen([sys.executable, __file__, 'subprocess'], stdout=PIPE, **kwargs)
p.stdout.readline() line = p.stdout.readline()
if not isinstance(line, str):
line = line.decode('ascii')
assert line == 'ready\n'
p.send_signal(signal.SIGINT) p.send_signal(signal.SIGINT)
# Wait up to 3 seconds for child process to die
for i in range(30): for i in range(30):
if p.poll() is not None: if p.poll() is not None:
break break
time.sleep(0.1) time.sleep(0.1)
else: else:
# Kill unresponsive child and exit with error 1
p.terminate() p.terminate()
p.wait()
sys.exit(1) sys.exit(1)
sys.exit(p.returncode) sys.exit(p.returncode)
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