Bug 1407203 - Wait for websocketProcessBridge to exit; r?jmaher draft
authorDan Minor <dminor@mozilla.com>
Mon, 16 Oct 2017 15:47:58 -0400
changeset 682398 4aea2ace2d5aca090f24e1ddb128d71171394e1b
parent 682254 a29052590fc6538b89641e690d11731ca8e78120
child 736384 9bf08dcf3fe3132797a56dccad659739b4c21f2e
push id85092
push userbmo:dminor@mozilla.com
push dateWed, 18 Oct 2017 15:27:53 +0000
reviewersjmaher
bugs1407203
milestone58.0a1
Bug 1407203 - Wait for websocketProcessBridge to exit; r?jmaher We are seeing failures starting websocketProcessBridge due to the port being in use. It is most likely a previously started websocketProcessBridge process that is using the port. On Windows, mozprocess.kill() calls TerminateJobObject/TerminateProcess and GetExitCodeProcess, but these are asynchronous and don't wait for the process to actually exit. Adding a wait call should guarantee the process has exited before continuing which will hopefully ensure the port is free by the time we start an additional websocketProcessBridge. MozReview-Commit-ID: HGyjEsy1Ons
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1208,16 +1208,17 @@ class MochitestDesktop(object):
                 self.log.info('Stopping ssltunnel')
                 self.sslTunnel.stop()
             except Exception:
                 self.log.critical('Exception stopping ssltunnel')
 
         if self.websocketProcessBridge is not None:
             try:
                 self.websocketProcessBridge.kill()
+                self.websocketProcessBridge.wait()
                 self.log.info('Stopping websocket/process bridge')
             except Exception:
                 self.log.critical('Exception stopping websocket/process bridge')
 
     def copyExtraFilesToProfile(self, options):
         "Copy extra files or dirs specified on the command line to the testing profile."
         for f in options.extraProfileFiles:
             abspath = self.getFullPath(f)