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
This commit is contained in:
Robert Collins 2014-09-19 10:07:52 +12:00
parent f804ce594a
commit 7d4a17f2ad
1 changed files with 4 additions and 0 deletions

View File

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