DevTools/Intermittents: Difference between revisions

Jump to navigation Jump to search
Fixed more link syntax typos
(Fixed small link typo and added an example of orange factor robot comment)
(Fixed more link syntax typos)
Line 12: Line 12:
posts weekly updates to the relevant bugs in Bugzilla (see [https://bugzilla.mozilla.org/show_bug.cgi?id=1250523#c4 an example here]).
posts weekly updates to the relevant bugs in Bugzilla (see [https://bugzilla.mozilla.org/show_bug.cgi?id=1250523#c4 an example here]).


You can also see oranges in Bugzilla.  Go to [[https://bugzilla.mozilla.org/userprefs.cgi?tab=settings the settings page]] and enable "When viewing a bug, show its corresponding Orange Factor page".
You can also see oranges in Bugzilla.  Go to [https://bugzilla.mozilla.org/userprefs.cgi?tab=settings the settings page] and enable "When viewing a bug, show its corresponding Orange Factor page".


= Reproducing Test Failures locally =
= Reproducing Test Failures locally =
Line 24: Line 24:


First, try running the test in isolation.  You can use the <code>--repeat</code> and <code>--run-until-failure</code> flags to <code>mach mochitest</code> to automate this a bit.  It's nice to do this sort of thing in a VM (or using Xnest on Linux) to avoid locking up your machine.  Mozilla provides an
First, try running the test in isolation.  You can use the <code>--repeat</code> and <code>--run-until-failure</code> flags to <code>mach mochitest</code> to automate this a bit.  It's nice to do this sort of thing in a VM (or using Xnest on Linux) to avoid locking up your machine.  Mozilla provides an
[[https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_the_VM easy-to-use VM]]
[https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_the_VM easy-to-use VM]


Sometimes, though, a test will only fail if it is run in conjunction with one or more other tests.  You can use the <code>--start-at</code> and <code>--end-at</code> flags to <code>mach mochitest</code> to run a group of tests together.
Sometimes, though, a test will only fail if it is run in conjunction with one or more other tests.  You can use the <code>--start-at</code> and <code>--end-at</code> flags to <code>mach mochitest</code> to run a group of tests together.


For some jobs, but not all, you can get an [[https://jonasfj.dk/2016/03/one-click-loaners-with-taskcluster/ interactive shell from TaskCluster]].
For some jobs, but not all, you can get an [https://jonasfj.dk/2016/03/one-click-loaners-with-taskcluster/ interactive shell from TaskCluster].


There's also a [[https://wiki.mozilla.org/Electrolysis/e10s_test_tips handy page of e10s test debugging tips]] that is worth a read.
There's also a [[Electrolysis/e10s test tips|handy page of e10s test debugging tips]] that is worth a read.


Because intermittents are often caused by race conditions, it's sometimes useful to enable Chaos Mode.  This changes timings and event orderings a bit. The simplest way to do this is to enable it in a specific test, by
Because intermittents are often caused by race conditions, it's sometimes useful to enable Chaos Mode.  This changes timings and event orderings a bit. The simplest way to do this is to enable it in a specific test, by
calling <code>SimpleTest.testInChaosMode</code>.  You can also set the <code>MOZ_CHAOSMODE</code> environment variable, or even hack <code>mfbt/ChaosMode.cpp</code> directly.
calling <code>SimpleTest.testInChaosMode</code>.  You can also set the <code>MOZ_CHAOSMODE</code> environment variable, or even hack <code>mfbt/ChaosMode.cpp</code> directly.


The amazing rr has [[http://robert.ocallahan.org/2016/02/introducing-rr-chaos-mode.html its own chaos mode]].
The amazing rr has [http://robert.ocallahan.org/2016/02/introducing-rr-chaos-mode.html its own chaos mode].
This can also sometimes reproduce a failure that isn't ordinarily reproducible.  While it's difficult to debug JS bugs using rr, often if you can reliable reproduce the failure you can at least experiment (see below) to attempt a fix.
This can also sometimes reproduce a failure that isn't ordinarily reproducible.  While it's difficult to debug JS bugs using rr, often if you can reliable reproduce the failure you can at least experiment (see below) to attempt a fix.


130

edits

Navigation menu