Skip to content

Commit 538ae81

Browse files
TTimozpostfacto
authored andcommitted
test_p2p : make the RunProcessInThread a daemon thread so we cleanly exit on error.
1 parent 8343dd9 commit 538ae81

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_p2p.py

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class RunProcessInThread(threading.Thread):
1919

2020
def __init__( self, tag, cmdline, env, **popen_kwargs ):
2121
threading.Thread.__init__( self, name=tag )
22+
self.daemon = True
2223
self.tag = tag
2324
self.cmdline = cmdline
2425
if env:
@@ -63,6 +64,7 @@ def join( self, timeout ):
6364
threading.Thread.join( self, timeout )
6465
if self.isAlive():
6566
self.WriteLn( "Still running after %d seconds. Killing" % timeout )
67+
global g_failed
6668
g_failed = True
6769
self.process.kill()
6870

0 commit comments

Comments
 (0)