Skip to content

Commit

Permalink
test_p2p : make the RunProcessInThread a daemon thread so we cleanly …
Browse files Browse the repository at this point in the history
…exit on error.
  • Loading branch information
TTimo authored and zpostfacto committed Sep 30, 2024
1 parent 8343dd9 commit 538ae81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_p2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -63,6 +64,7 @@ def join( self, timeout ):
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()

Expand Down

0 comments on commit 538ae81

Please sign in to comment.