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
--- 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,