test_p2p : make the RunProcessInThread a daemon thread so we cleanly exit on error.

This commit is contained in:
Timothee 'TTimo' Besset
2024-09-29 15:33:45 -05:00
committed by Fletcher Dunn
parent 8343dd9c4a
commit 538ae81ec9
+2
View File
@@ -19,6 +19,7 @@ class RunProcessInThread(threading.Thread):
def __init__( self, tag, cmdline, env, **popen_kwargs ):
threading.Thread.__init__( self, name=tag )
self.daemon = True
self.tag = tag
self.cmdline = cmdline
if env:
@@ -63,6 +64,7 @@ class RunProcessInThread(threading.Thread):
threading.Thread.join( self, timeout )
if self.isAlive():
self.WriteLn( "Still running after %d seconds. Killing" % timeout )
global g_failed
g_failed = True
self.process.kill()