From 7d4a17f2ad72bf1ffa979f57a59bb2bd2727afe3 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Fri, 19 Sep 2014 10:07:52 +1200 Subject: [PATCH] Close standard fds in test child process The std fd's are shared with parent processes, which makes testr think that we still have test workers, even though this isn't a test process, its a live server. Change-Id: I516a6a9bd9a98abffeb182189038763ea94618f6 Partial-Bug: #1357578 --- nova/tests/integrated/test_multiprocess_api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/tests/integrated/test_multiprocess_api.py b/nova/tests/integrated/test_multiprocess_api.py index 3227fb1aa9b4..e93a8c494b8a 100644 --- a/nova/tests/integrated/test_multiprocess_api.py +++ b/nova/tests/integrated/test_multiprocess_api.py @@ -19,6 +19,7 @@ Test multiprocess enabled API service. import errno import os import signal +import sys import time import traceback @@ -59,6 +60,9 @@ class MultiprocessWSGITest(integrated_helpers._IntegratedTestBase): # to catch all exceptions and make sure nothing leaks out, in # particular SystemExit, which is raised by sys.exit(). We use # os._exit() which doesn't have this problem. + sys.stdin.close() + sys.stdout.close() + sys.stderr.close() status = 0 try: launcher = service.process_launcher()