Browse Source

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
tags/2014.2.rc1
Robert Collins 5 years ago
parent
commit
7d4a17f2ad
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      nova/tests/integrated/test_multiprocess_api.py

+ 4
- 0
nova/tests/integrated/test_multiprocess_api.py View File

@@ -19,6 +19,7 @@ Test multiprocess enabled API service.
19 19
 import errno
20 20
 import os
21 21
 import signal
22
+import sys
22 23
 import time
23 24
 import traceback
24 25
 
@@ -59,6 +60,9 @@ class MultiprocessWSGITest(integrated_helpers._IntegratedTestBase):
59 60
             # to catch all exceptions and make sure nothing leaks out, in
60 61
             # particular SystemExit, which is raised by sys.exit(). We use
61 62
             # os._exit() which doesn't have this problem.
63
+            sys.stdin.close()
64
+            sys.stdout.close()
65
+            sys.stderr.close()
62 66
             status = 0
63 67
             try:
64 68
                 launcher = service.process_launcher()

Loading…
Cancel
Save