summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/Server/server-test.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/Server/server-test.py b/Tests/Server/server-test.py
index 72f82ba..14767f4 100644
--- a/Tests/Server/server-test.py
+++ b/Tests/Server/server-test.py
@@ -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)