Explicit stop in child process

This commit is contained in:
David Cramer 2015-03-29 12:52:22 -07:00
parent 827eb23ddb
commit acfbd2bb58
1 changed files with 4 additions and 1 deletions

View File

@ -79,10 +79,13 @@ class ThreadedTransportTest(TestCase):
# Log from the parent process - starts the worker thread
transport.async_send(event1, None, None, None)
childpid = os.fork()
if childpid == 0:
# Log from the child process
transport.async_send(event2, None, None, None)
time.sleep(0.1)
# Ensure threaded worker has finished
transport.get_worker().stop()
os._exit(0)
# Wait for the child process to finish