Skip to content

Commit

Permalink
[CI] Ensure that running threads started as dependencies of a test ar…
Browse files Browse the repository at this point in the history
…e freed, even if the process has never been started (#22715)
  • Loading branch information
vivien-apple authored and pull[bot] committed Jun 28, 2023
1 parent 713c614 commit 8309641
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/tests/chiptest/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(self, runner, command):
self.lastLogIndex = 0
self.kvsPathSet = {'/tmp/chip_kvs'}
self.options = None
self.killed = False

def start(self, options=None):
if not self.process:
Expand Down Expand Up @@ -85,9 +86,13 @@ def waitForMessage(self, message):
def kill(self):
if self.process:
self.process.kill()
self.killed = True

def wait(self, timeout=None):
while True:
# If the App was never started, AND was killed, exit immediately
if self.killed:
return 0
# If the App was never started, wait cannot be called on the process
if self.process == None:
time.sleep(0.1)
Expand Down

0 comments on commit 8309641

Please sign in to comment.