summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-19 13:50:19 +0100
committerSteve Sakoman <steve@sakoman.com>2020-10-22 08:22:44 -1000
commited912771ea98c42f61bf927b1ca708650b0bed4c (patch)
tree3a22c17b43a987ead2e60b770907b4b934ce876e /meta/lib/oeqa/utils
parent89e6fc44a378cb3489376d7193672cdf94c504b6 (diff)
downloadopenembedded-core-contrib-ed912771ea98c42f61bf927b1ca708650b0bed4c.tar.gz
oeqa: Add sync call to command execution
We previously put a sync call into devtool to try and combat the bitbake timeout issues on the autobuilder. It isn't enough as the timeouts occur mid test. They are also occurring on non-devtool tests. Add in sync calls around command execution instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ceca5ed121e2b54415a7ab3a217882e4ea86923a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/commands.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index f7f8c16bf0..8059cbce3e 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -167,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()
@@ -184,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