mirror of
https://git.yoctoproject.org/poky
synced 2026-04-17 00:32:13 +02:00
oeqa/utils/command: Improve stdin handling in runCmd
Occasionally we've been seeing leftover threads from runCmd. The stdin test assumes we clean up all threads but the code assumes that the daemonic thread can be left behind. The issue can be reproduced by adding a time.sleep(10) to the end of writeThread() which will mean it stays resident past the end of the command. We may as well add it to the threads list and clean it up properly, hopefully removing the race in the tests from the autobuilder. [YOCTO #13055] (From OE-Core rev: 9b251dcaffe52d32c1faf41ab57ab414fbc29722) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -95,7 +95,9 @@ class Command(object):
|
||||
# reason, the main process will still exit, which will then
|
||||
# kill the write thread.
|
||||
if self.data:
|
||||
threading.Thread(target=writeThread, daemon=True).start()
|
||||
thread = threading.Thread(target=writeThread, daemon=True)
|
||||
thread.start()
|
||||
self.threads.append(thread)
|
||||
if self.process.stderr:
|
||||
thread = threading.Thread(target=readStderrThread)
|
||||
thread.start()
|
||||
|
||||
Reference in New Issue
Block a user