diff mbox series

[v2,8/8] oeqa qemurunner.py: try to avoid reading one character at a time

Message ID 20230209080936.148489-9-mikko.rapeli@linaro.org
State Accepted, archived
Commit 0049f6757f6f956fb4cc77b3df6a672c20b53cf4
Headers show
Series fix oeqa runtime test framework when qemu hangs | expand

Commit Message

Mikko Rapeli Feb. 9, 2023, 8:09 a.m. UTC
Read from serial console with a small delay to bundle data to e.g.
full lines. Reading one character at a time is not needed and causes
busy looping.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/lib/oeqa/utils/qemurunner.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 8e3484385d..0f4157d318 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -665,6 +665,8 @@  class QemuRunner:
             except InterruptedError:
                 continue
             if sread:
+                # try to avoid reading single character at a time
+                time.sleep(0.1)
                 answer = self.server_socket.recv(1024)
                 if answer:
                     data += answer.decode('utf-8')