Automatic debug breaking on a test failure

Felipe G felipc at gmail.com
Tue Nov 5 16:45:22 UTC 2013


And the fix to bug 916797 just landed in fx-team, so you can now treat
everything from the original e-mail as actually true :)

Felipe


On Mon, Nov 4, 2013 at 2:22 PM, Felipe G <felipc at gmail.com> wrote:

> In the meantime, if you need to run multiple tests, --repeat=N can be used
> instead of --run-until-failure,  which when combined with
> --debug-on-failure will have the same effect (break execution at the first
> TEST-UNEXPECTED-FAIL).
>
>
> On Mon, Nov 4, 2013 at 2:17 PM, Gijs Kruitbosch <gijskruitbosch at gmail.com>wrote:
>
>>  As Felipe and I just discussed on IRC, sadly --run-until-failure
>> doesn't work with multiple tests yet (
>> https://bugzilla.mozilla.org/show_bug.cgi?id=916797 ). 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]
>> https://mail.mozilla.org/pipermail/firefox-dev/2013-October/001043.html
>> [2] https://bugzilla.mozilla.org/show_bug.cgi?id=932144
>> [3] https://bugzilla.mozilla.org/show_bug.cgi?id=875463
>>
>>
>>
>> _______________________________________________
>> firefox-dev mailing listfirefox-dev at mozilla.orghttps://mail.mozilla.org/listinfo/firefox-dev
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20131105/61859a32/attachment.html>


More information about the firefox-dev mailing list