Skip to content

Commit 0cf7694

Browse files
authored
[CI] Ensure that running threads started as dependencies of a test are freed, even if the process has never been started (project-chip#22715)
1 parent 21b708e commit 0cf7694

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/tests/chiptest/test_definition.py

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def __init__(self, runner, command):
3939
self.lastLogIndex = 0
4040
self.kvsPathSet = {'/tmp/chip_kvs'}
4141
self.options = None
42+
self.killed = False
4243

4344
def start(self, options=None):
4445
if not self.process:
@@ -85,9 +86,13 @@ def waitForMessage(self, message):
8586
def kill(self):
8687
if self.process:
8788
self.process.kill()
89+
self.killed = True
8890

8991
def wait(self, timeout=None):
9092
while True:
93+
# If the App was never started, AND was killed, exit immediately
94+
if self.killed:
95+
return 0
9196
# If the App was never started, wait cannot be called on the process
9297
if self.process == None:
9398
time.sleep(0.1)

0 commit comments

Comments
 (0)