summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-31 18:28:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-01 14:03:27 +0100
commit8fac8c61565977c775d8ede5bddc856b7767a3e4 (patch)
tree4499571c73eb5ebf79b67014e94065979b1d9859
parent881ed7938f84ba89b9bb20ce8e45ef9d85e80cb8 (diff)
downloadopenembedded-core-contrib-8fac8c61565977c775d8ede5bddc856b7767a3e4.tar.gz
oeqa/qemurunner: Improve timeout handling
We had debugging for qemu faiing to start which was no longer reachable after the QMP changes. Reorder the code to enable this debugging to work again which may allow insight into autobuilder failures in this area. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py50
1 files changed, 22 insertions, 28 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 4f094e29c7..0032f6ed8d 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -277,14 +277,33 @@ class QemuRunner:
if self.runqemu_exited:
self.logger.warning("runqemu after timeout")
- return False
if self.runqemu.returncode:
self.logger.warning('runqemu exited with code %d' % self.runqemu.returncode)
- return False
if not self.is_alive():
- self.logger.warning('is_alive() failed later')
+ self.logger.error("Qemu pid didn't appear in %s seconds (%s)" %
+ (self.runqemutime, time.strftime("%D %H:%M:%S")))
+
+ qemu_pid = None
+ if os.path.isfile(self.qemu_pidfile):
+ with open(self.qemu_pidfile, 'r') as f:
+ qemu_pid = f.read().strip()
+
+ self.logger.error("Status information, poll status: %s, pidfile exists: %s, pidfile contents %s, proc pid exists %s"
+ % (self.runqemu.poll(), os.path.isfile(self.qemu_pidfile), str(qemu_pid), os.path.exists("/proc/" + str(qemu_pid))))
+
+ # Dump all processes to help us to figure out what is going on...
+ ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,pri,ni,command '], stdout=subprocess.PIPE).communicate()[0]
+ processes = ps.decode("utf-8")
+ self.logger.debug("Running processes:\n%s" % processes)
+ self._dump_host()
+ op = self.getOutput(output)
+ self.stop()
+ if op:
+ self.logger.error("Output from runqemu:\n%s" % op)
+ else:
+ self.logger.error("No output from runqemu.\n")
return False
# Create the client socket for the QEMU Monitor Control Socket
@@ -326,31 +345,6 @@ class QemuRunner:
# Release the qemu porcess to continue running
self.run_monitor('cont')
- if not self.is_alive():
- self.logger.error("Qemu pid didn't appear in %s seconds (%s)" %
- (self.runqemutime, time.strftime("%D %H:%M:%S")))
-
- qemu_pid = None
- if os.path.isfile(self.qemu_pidfile):
- with open(self.qemu_pidfile, 'r') as f:
- qemu_pid = f.read().strip()
-
- self.logger.error("Status information, poll status: %s, pidfile exists: %s, pidfile contents %s, proc pid exists %s"
- % (self.runqemu.poll(), os.path.isfile(self.qemu_pidfile), str(qemu_pid), os.path.exists("/proc/" + str(qemu_pid))))
-
- # Dump all processes to help us to figure out what is going on...
- ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,pri,ni,command '], stdout=subprocess.PIPE).communicate()[0]
- processes = ps.decode("utf-8")
- self.logger.debug("Running processes:\n%s" % processes)
- self._dump_host()
- op = self.getOutput(output)
- self.stop()
- if op:
- self.logger.error("Output from runqemu:\n%s" % op)
- else:
- self.logger.error("No output from runqemu.\n")
- return False
-
# We are alive: qemu is running
out = self.getOutput(output)
netconf = False # network configuration is not required by default