Bug 1300163 - Fix hidden tracebacks in mochitest runtests.py, r?armenzg draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 02 Sep 2016 14:39:34 -0400
changeset 410291 9d4cdd8aa6c9bdc1ffe4f03a2df46a186229e77b
parent 410290 c8f793a43bfbe096b10f62abb1ad89a96546d6e5
child 410292 8645df300bd3877658d97d01e0c870a3793a1295
push id28715
push userahalberstadt@mozilla.com
push dateTue, 06 Sep 2016 16:35:28 +0000
reviewersarmenzg
bugs1300163
milestone51.0a1
Bug 1300163 - Fix hidden tracebacks in mochitest runtests.py, r?armenzg I had a mistake in my code that resulted in an exception being thrown when starting the mochitest servers. However, the log just showed a timeout. It was very confusing. After some digging, I found that there's a large try/finally block (with no except) in runtests.py. The exception wasn't being displayed because of the finally block. This try/finally block had an inner try/except/finally that wrapped part of the code. This patch simply removes that inner block and dedents the 'except' clause to attach to the original try/finally. MozReview-Commit-ID: 4lsKGpizfH7
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2393,44 +2393,42 @@ class MochitestDesktop(MochitestBase):
 
             if options.marionette:
                 host, port = options.marionette.split(':')
                 marionette_args['host'] = host
                 marionette_args['port'] = int(port)
 
             self.log.info("runtests.py | Running with e10s: {}".format(options.e10s))
             self.log.info("runtests.py | Running tests: start.\n")
-            try:
-                status = self.runApp(testURL,
-                                     self.browserEnv,
-                                     options.app,
-                                     profile=self.profile,
-                                     extraArgs=options.browserArgs,
-                                     utilityPath=options.utilityPath,
-                                     debuggerInfo=debuggerInfo,
-                                     valgrindPath=valgrindPath,
-                                     valgrindArgs=valgrindArgs,
-                                     valgrindSuppFiles=valgrindSuppFiles,
-                                     symbolsPath=options.symbolsPath,
-                                     timeout=timeout,
-                                     detectShutdownLeaks=detectShutdownLeaks,
-                                     screenshotOnFail=options.screenshotOnFail,
-                                     bisectChunk=options.bisectChunk,
-                                     quiet=options.quiet,
-                                     marionette_args=marionette_args,
-                                     )
-            except KeyboardInterrupt:
-                self.log.info("runtests.py | Received keyboard interrupt.\n")
-                status = -1
-            except:
-                traceback.print_exc()
-                self.log.error(
-                    "Automation Error: Received unexpected exception while running application\n")
-                status = 1
-
+            status = self.runApp(testURL,
+                                 self.browserEnv,
+                                 options.app,
+                                 profile=self.profile,
+                                 extraArgs=options.browserArgs,
+                                 utilityPath=options.utilityPath,
+                                 debuggerInfo=debuggerInfo,
+                                 valgrindPath=valgrindPath,
+                                 valgrindArgs=valgrindArgs,
+                                 valgrindSuppFiles=valgrindSuppFiles,
+                                 symbolsPath=options.symbolsPath,
+                                 timeout=timeout,
+                                 detectShutdownLeaks=detectShutdownLeaks,
+                                 screenshotOnFail=options.screenshotOnFail,
+                                 bisectChunk=options.bisectChunk,
+                                 quiet=options.quiet,
+                                 marionette_args=marionette_args,
+                                 )
+        except KeyboardInterrupt:
+            self.log.info("runtests.py | Received keyboard interrupt.\n")
+            status = -1
+        except:
+            traceback.print_exc()
+            self.log.error(
+                "Automation Error: Received unexpected exception while running application\n")
+            status = 1
         finally:
             self.stopServers()
 
         mozleak.process_leak_log(
             self.leak_report_file,
             leak_thresholds=options.leakThresholds,
             ignore_missing_leaks=options.ignoreMissingLeaks,
             log=self.log,