diff mbox series

[07/14] oeqa qemurunner.py: use os.set_blocking() instead of fcntl()

Message ID 20230120144450.2913935-8-mikko.rapeli@linaro.org
State New
Headers show
Series oeqa runtime tests when qemu hangs | expand

Commit Message

Mikko Rapeli Jan. 20, 2023, 2:44 p.m. UTC
It's now available since python 3.5. Then add debug prints
to leave traces if something still hangs or fails.

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

Patch

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index b5fed6c9fe..49ec3858c7 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -123,12 +123,12 @@  class QemuRunner:
                 f.write("%s" % msg)
 
     def getOutput(self, o):
-        import fcntl
-        fl = fcntl.fcntl(o, fcntl.F_GETFL)
-        fcntl.fcntl(o, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+        os.set_blocking(o.fileno(), False)
         try:
+            self.logger.debug('Calling read()')
             return os.read(o.fileno(), 1000000).decode("utf-8")
         except BlockingIOError:
+            self.logger.debug('BlockingIOError but should not have happened!')
             return ""