aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@linaro.org>2023-01-20 16:44:50 +0200
committerLuca Ceresoli <luca.ceresoli@bootlin.com>2023-01-20 16:16:40 +0100
commitceb42206cdf26f767dc87f68d570b06815a5bb5c (patch)
tree187bf14422004bfc92df7f2441ee44dd1db43d1c
parentefab22cb9031ceb5537eb0549bbf088c9c85ac43 (diff)
downloadopenembedded-core-contrib-lucaceresoli/master-next.tar.gz
oeqa qemurunner.py: improve logging in run_serial()lucaceresoli/master-next-successlucaceresoli/master-next
When serial communication times outs, write note also to bitbake task output. Then add a small sleep to collect more output to avoid reading data one character at a time. This makes logs much more readable. Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 0e720ef5f0..b1c6ab8ce7 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -670,12 +670,15 @@ class QemuRunner:
now = time.time()
if now >= end:
data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout
+ self.logger.debug("run_serial(): command timed out after %d seconds without output" % timeout)
break
try:
sread, _, _ = select.select([self.server_socket],[],[], end - now)
except InterruptedError:
continue
if sread:
+ # try to avoid reading single character at a time, makes logs readable
+ time.sleep(0.1)
answer = self.server_socket.recv(1024)
if answer:
data += answer.decode('utf-8')