aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2015-08-25 13:58:47 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-25 23:23:33 +0100
commit6497fddf7f6c4a59e16dab4a9daeb3614a61a8dc (patch)
treef74f7f2521fa870a9170ca2a744f1d57f9e16417
parentdbfb2efcd7240a0a6a413f1b37c399b66fa79ca9 (diff)
downloadopenembedded-core-contrib-6497fddf7f6c4a59e16dab4a9daeb3614a61a8dc.tar.gz
qemurunner: Shut down logging thread successfully when test fails
Before this change on a test failure an exception would be generated due to runqemu being killed before the logging thread which was on the other end of the socket. The exception was actually correct saying there was no data on a socket marked readable, but this was because the qemu process was killed before the listener thread. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 33f31852a7..d079072af8 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -209,6 +209,7 @@ class QemuRunner:
def stop(self):
+ self.stop_thread()
if self.runqemu:
logger.info("Sending SIGTERM to runqemu")
try:
@@ -228,7 +229,6 @@ class QemuRunner:
self.server_socket = None
self.qemupid = None
self.ip = None
- self.stop_thread()
def stop_thread(self):
if self.thread and self.thread.is_alive():
@@ -403,6 +403,7 @@ class LoggingThread(threading.Thread):
elif self.serversock.fileno() == event[0]:
self.logger.info("Connection request received")
self.readsock, _ = self.serversock.accept()
+ self.readsock.setblocking(0)
poll.unregister(self.serversock.fileno())
poll.register(self.readsock.fileno())