summaryrefslogtreecommitdiffstats
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:53 +0100
commit55077eac1ef2df72e949fdc59c2f3afc85b36ecd (patch)
tree38eba5ddebd8c620edc88da5fade8958f798a3fc
parent15c8835445db4d205e8a33f92082b6e6f8eddd02 (diff)
downloadpoky-55077eac1ef2df72e949fdc59c2f3afc85b36ecd.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. (From OE-Core rev: 6497fddf7f6c4a59e16dab4a9daeb3614a61a8dc) 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:
209 209
210 def stop(self): 210 def stop(self):
211 211
212 self.stop_thread()
212 if self.runqemu: 213 if self.runqemu:
213 logger.info("Sending SIGTERM to runqemu") 214 logger.info("Sending SIGTERM to runqemu")
214 try: 215 try:
@@ -228,7 +229,6 @@ class QemuRunner:
228 self.server_socket = None 229 self.server_socket = None
229 self.qemupid = None 230 self.qemupid = None
230 self.ip = None 231 self.ip = None
231 self.stop_thread()
232 232
233 def stop_thread(self): 233 def stop_thread(self):
234 if self.thread and self.thread.is_alive(): 234 if self.thread and self.thread.is_alive():
@@ -403,6 +403,7 @@ class LoggingThread(threading.Thread):
403 elif self.serversock.fileno() == event[0]: 403 elif self.serversock.fileno() == event[0]:
404 self.logger.info("Connection request received") 404 self.logger.info("Connection request received")
405 self.readsock, _ = self.serversock.accept() 405 self.readsock, _ = self.serversock.accept()
406 self.readsock.setblocking(0)
406 poll.unregister(self.serversock.fileno()) 407 poll.unregister(self.serversock.fileno())
407 poll.register(self.readsock.fileno()) 408 poll.register(self.readsock.fileno())
408 409