Automatic debug breaking on a test failure

Gijs Kruitbosch gijskruitbosch at
Mon Nov 4 16:17:32 UTC 2013

As Felipe and I just discussed on IRC, sadly --run-until-failure doesn't 
work with multiple tests yet ( ). He/We will be 
trying to fix that ASAP, as it's a bit misleading as-is (hence the 
beautiful write-up below!).

Otherwise, please read and use the below! It is awesome and will really 
simplify debugging and fixing (random/intermittent) test failures. :-)

~ Gijs

On 04/11/13, 17:05 , Felipe G wrote:
> 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>
> Felipe
> [1] 
> [2]
> [3]
> _______________________________________________
> firefox-dev mailing list
> firefox-dev at

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

More information about the firefox-dev mailing list