Skip to content
Snippets Groups Projects
Commit d56f9237 authored by Brad King's avatar Brad King
Browse files

Tests: Teach Server test to wait for server exit

We expect the server to exit when its communication pipes are closed.
Close them and wait for the server to exit.  If supported by the current
version of python, kill the server if it does not exit after a few
seconds.
parent 8491a539
No related branches found
No related tags found
No related merge requests found
......@@ -102,4 +102,18 @@ for obj in testData:
print("Completed")
# Tell the server to exit.
proc.stdin.close()
proc.stdout.close()
# Wait for the server to exit.
# If this version of python supports it, terminate the server after a timeout.
try:
proc.wait(timeout=5)
except TypeError:
proc.wait()
except:
proc.terminate()
raise
sys.exit(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment