Automatic debug breaking on a test failure

Felipe G felipc at
Mon Nov 4 16:05:52 UTC 2013

Following the great addition of the --jsdebugger option for mochitests [1],
yet another new feature just landed [2]: if you use the --jsdebugger to
have the debugger attached during your test run, you now have the option to
automatically break execution and enter the debugger whenever a testcase
fails. Very useful to examine the code and state at the exact place the
test failed without having to set breakpoints in advance!

To do that, just use the --debug-on-failure option in addition to the
--jsdebugger option. Like so:

./mach mochitest-browser --jsdebugger --debug-on-failure <my-test>

It should work with mochitest-{plain,chrome,browser}

And there's more! If you ever thought "oh I wish there was a way to
automatically catch an intermittent failure w/ the debugger with no
effort", then you're in for a treat..

Landed a couple of months ago is an option to repeatedly run a test (or a
directory, or a set of tests, really) several times until it fails [3]. If
you combine it with these two new recent features, what you get is a
command that will do everything for you and pause execution when the
intermittent test actually fails..

./mach mochitest-browser --jsdebugger --debug-on-failure
--run-until-failure <my-test>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the firefox-dev mailing list