diff options
Diffstat (limited to 'poky/meta/lib/oeqa/utils/commands.py')
-rw-r--r-- | poky/meta/lib/oeqa/utils/commands.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/poky/meta/lib/oeqa/utils/commands.py b/poky/meta/lib/oeqa/utils/commands.py index f1679875dc..8059cbce3e 100644 --- a/poky/meta/lib/oeqa/utils/commands.py +++ b/poky/meta/lib/oeqa/utils/commands.py @@ -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() @@ -165,7 +167,7 @@ class Result(object): pass -def runCmd(command, ignore_status=False, timeout=None, assert_error=True, +def runCmd(command, ignore_status=False, timeout=None, assert_error=True, sync=True, native_sysroot=None, limit_exc_output=0, output_log=None, **options): result = Result() @@ -182,6 +184,12 @@ def runCmd(command, ignore_status=False, timeout=None, assert_error=True, cmd = Command(command, timeout=timeout, output_log=output_log, **options) cmd.run() + # tests can be heavy on IO and if bitbake can't write out its caches, we see timeouts. + # call sync around the tests to ensure the IO queue doesn't get too large, taking any IO + # hit here rather than in bitbake shutdown. + if sync: + os.system("sync") + result.command = command result.status = cmd.status result.output = cmd.output @@ -351,10 +359,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, finally: targetlogger.removeHandler(handler) - try: - qemu.stop() - except: - pass + qemu.stop() def updateEnv(env_file): """ |