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:49 +0100
commit13ed11d90995d60255fa4a7868a3f93d3c16f87a (patch)
tree119615baf2ecd9225b1bbfe8019abe2876bf6c08
parent3914105a25fe695c378f9a12114d67ec6c015b7d (diff)
downloadpoky-13ed11d90995d60255fa4a7868a3f93d3c16f87a.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. (From OE-Core rev: 8fac8c61565977c775d8ede5bddc856b7767a3e4) 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:
277 277
278 if self.runqemu_exited: 278 if self.runqemu_exited:
279 self.logger.warning("runqemu after timeout") 279 self.logger.warning("runqemu after timeout")
280 return False
281 280
282 if self.runqemu.returncode: 281 if self.runqemu.returncode:
283 self.logger.warning('runqemu exited with code %d' % self.runqemu.returncode) 282 self.logger.warning('runqemu exited with code %d' % self.runqemu.returncode)
284 return False
285 283
286 if not self.is_alive(): 284 if not self.is_alive():
287 self.logger.warning('is_alive() failed later') 285 self.logger.error("Qemu pid didn't appear in %s seconds (%s)" %
286 (self.runqemutime, time.strftime("%D %H:%M:%S")))
287
288 qemu_pid = None
289 if os.path.isfile(self.qemu_pidfile):
290 with open(self.qemu_pidfile, 'r') as f:
291 qemu_pid = f.read().strip()
292
293 self.logger.error("Status information, poll status: %s, pidfile exists: %s, pidfile contents %s, proc pid exists %s"
294 % (self.runqemu.poll(), os.path.isfile(self.qemu_pidfile), str(qemu_pid), os.path.exists("/proc/" + str(qemu_pid))))
295
296 # Dump all processes to help us to figure out what is going on...
297 ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,pri,ni,command '], stdout=subprocess.PIPE).communicate()[0]
298 processes = ps.decode("utf-8")
299 self.logger.debug("Running processes:\n%s" % processes)
300 self._dump_host()
301 op = self.getOutput(output)
302 self.stop()
303 if op:
304 self.logger.error("Output from runqemu:\n%s" % op)
305 else:
306 self.logger.error("No output from runqemu.\n")
288 return False 307 return False
289 308
290 # Create the client socket for the QEMU Monitor Control Socket 309 # Create the client socket for the QEMU Monitor Control Socket
@@ -326,31 +345,6 @@ class QemuRunner:
326 # Release the qemu porcess to continue running 345 # Release the qemu porcess to continue running
327 self.run_monitor('cont') 346 self.run_monitor('cont')
328 347
329 if not self.is_alive():
330 self.logger.error("Qemu pid didn't appear in %s seconds (%s)" %
331 (self.runqemutime, time.strftime("%D %H:%M:%S")))
332
333 qemu_pid = None
334 if os.path.isfile(self.qemu_pidfile):
335 with open(self.qemu_pidfile, 'r') as f:
336 qemu_pid = f.read().strip()
337
338 self.logger.error("Status information, poll status: %s, pidfile exists: %s, pidfile contents %s, proc pid exists %s"
339 % (self.runqemu.poll(), os.path.isfile(self.qemu_pidfile), str(qemu_pid), os.path.exists("/proc/" + str(qemu_pid))))
340
341 # Dump all processes to help us to figure out what is going on...
342 ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,pri,ni,command '], stdout=subprocess.PIPE).communicate()[0]
343 processes = ps.decode("utf-8")
344 self.logger.debug("Running processes:\n%s" % processes)
345 self._dump_host()
346 op = self.getOutput(output)
347 self.stop()
348 if op:
349 self.logger.error("Output from runqemu:\n%s" % op)
350 else:
351 self.logger.error("No output from runqemu.\n")
352 return False
353
354 # We are alive: qemu is running 348 # We are alive: qemu is running
355 out = self.getOutput(output) 349 out = self.getOutput(output)
356 netconf = False # network configuration is not required by default 350 netconf = False # network configuration is not required by default