]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa qemurunner.py: add timeout to QMP calls
authorMikko Rapeli <mikko.rapeli@linaro.org>
Thu, 9 Feb 2023 08:09:34 +0000 (10:09 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 Feb 2023 09:25:41 +0000 (09:25 +0000)
When a qemu machine hangs, the QMP calls can hang for ever
too, and when this happens any failing test commands from ssh
runner may be followed by dump_monitor() calls which
then also hang. Hangs followed by hangs.

Use runqemutime at setup and run_monitor() specific timeout
for later calls.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
meta/lib/oeqa/utils/qemurunner.py

index 2e054447fced7c0666742b5eb6b0a7a8930c243e..bce00c696a498495249973ac38c08c78c8bb71a7 100644 (file)
@@ -350,6 +350,8 @@ class QemuRunner:
                     return False
 
             try:
+                # set timeout value for all QMP calls
+                self.qmp.settimeout(self.runqemutime)
                 self.qmp.connect()
                 connect_time = time.time()
                 self.logger.info("QMP connected to QEMU at %s and took %s seconds" %
@@ -628,6 +630,7 @@ class QemuRunner:
 
     def run_monitor(self, command, args=None, timeout=60):
         if hasattr(self, 'qmp') and self.qmp:
+            self.qmp.settimeout(timeout)
             if args is not None:
                 return self.qmp.cmd(command, args)
             else: