Auto-tools/Projects/Stockwell/disable-recommended: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
m (→‎Requesting review: - minor updates)
m (updated the post disable steps and reviewers)
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= This page is under construction! =
= [stockwell disable-recommended] =
 
== [stockwell disable-recommended] ==
When an intermittent-failure bug has recorded 150 or more failures in the last 21 days, the Orange Factor robot will change the bug's stockwell whiteboard tag to "[stockwell disable-recommended]". These bugs should be reviewed at least twice per week (current schedule is Monday and Thursday).
When an intermittent-failure bug has recorded 150 or more failures in the last 21 days, the Orange Factor robot will change the bug's stockwell whiteboard tag to "[stockwell disable-recommended]". These bugs should be reviewed at least twice per week (current schedule is Monday and Thursday).


This page describes how to review [stockwell disable-recommended] bugs.
This page describes how to review [stockwell disable-recommended] bugs.


=== Finding bugs to disable ===
== Finding bugs to disable ==
* Use bugzilla to find all bugs with whiteboard tag "[stockwell disable-recommended]".
* Use bugzilla to find all bugs with whiteboard tag "[stockwell disable-recommended]".
* For each disable-recommended bug, determine if the bug can be addressed by disabling tests.
* For each disable-recommended bug, determine if the bug can be addressed by disabling tests.
Line 23: Line 21:
*** If there is a patch under review or comments indicate that a fix is coming soon, consider postponing action on this bug.
*** If there is a patch under review or comments indicate that a fix is coming soon, consider postponing action on this bug.


=== Finding the manifest ===
== Finding the manifest ==
For each test to be disabled, find the associated test manifest:
For each test to be disabled, find the associated test manifest:
* Search for the test name in searchfox or dxr, or,
* Search for the test name in searchfox or dxr, or,
Line 45: Line 43:
</pre>
</pre>


=== Determining which platforms are affected ===
== Determining which platforms are affected ==
On OrangeFactor, check the detail view for the bug for the last 30 days. Look down the list of bugs for affected Platforms and Build Types. Does this test need to be disabled on all platforms, or only on some? For opt or debug builds, or both?
On OrangeFactor, check the detail view for the bug for the last 30 days. Look down the list of bugs for affected Platforms and Build Types. Does this test need to be disabled on all platforms, or only on some? For opt or debug builds, or both?


Line 83: Line 81:
</pre>
</pre>


The reason for this is we would be skipping on linux/windows/osx, but not linux32 or android.  Since this test doesn't run on Android, we would only be skipping on linux32- and a test that only runs on 1 platform doesn't provide a lot of value unless it is platform specific.
The reason for this is we would be skipping on linux/windows/osx, but not linux32 or android.  Since this test doesn't run on Android, we would only be skipping on linux32 - and a test that only runs on 1 platform doesn't provide a lot of value unless it is platform specific.


=== Updating a manifest to disable a test ===
== Updating a manifest to disable a test ==
There are 3 different types of manifest files, each with a different format:
There are 3 different types of manifest files, each with a different format:
* "'''ini'''" manifests like mochitest.ini, chrome.ini, browser.ini, xpcshell.ini
* "'''ini'''" manifests like mochitest.ini, chrome.ini, browser.ini, xpcshell.ini
Line 140: Line 138:


==== web-platform test manifests ====
==== web-platform test manifests ====
(we haven't talked about these yet)
web-platform tests are found in the mozilla-central repo under testing/web-platform/tests. These tests have their own, unique manifest format. Also, not all tests are listed in a manifest: A manifest is only created when a test needs to be skipped or otherwise annotated.
=== Making a patch ===
 
To actually disable a test, we need to update the manifest file in mozilla-central. Before doing that, create a mercurial patch containing the change, and upload the patch to bugzilla for review.
Manifests for web-platform tests are found in testing/web-platform/meta. The /meta directory structure parallels the /tests structure. For example testing/web-platform/meta/2dcontext/building-paths has manifests related to the tests in testing/web-platform/tests/2dcontext/building-paths.


Some useful mercurial commands for creating a patch with "mq":
When disabling a web-platform test, check to see if there is an existing manifest in the /meta directory for that test: If there is, modify the existing manifest as required; if not, add a new file (remember to add the new file to your patch with 'hg add').
hg qseries      # see what patches are in your queue / what is applied
hg qdiff        # see the file changes in the current patch
hg qnew          # create a new patch
hg qrefresh      # update your patch with local file changes
hg qrefresh -e  # edit the commit message associated with your patch


Here's an example of a patch disabling testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html, on Linux and Windows 10/debug:


I typically follow this workflow:
  diff --git a/testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html.ini b/testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html.ini
hg qnew bug1234567.patch
  new file mode 100644
<edit> <manifest>.ini
  --- /dev/null
hg qrefresh
  +++ b/testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html.ini
hg qdiff # self review
  @@ -0,0 +1,4 @@
  hg qrefresh -e
  +[multiple-report-policies.html]
<inside editor add comment |Bug 1234567 - disable <test> for frequent failures. r=gbrown| and save>
  + disabled:
cp .hg/patches/bug1234567.patch ~/
  +    if (os == "linux"): https://bugzilla.mozilla.org/show_bug.cgi?id=1435526
hg qpop
  +    if debug and (os == "win") and (version == "10.0.15063"): https://bugzilla.mozilla.org/show_bug.cgi?id=1435526


NOTE: the self review is a great time to make sure:
* If the test has expectations set, make sure to leave a blank line between the disabling conditions and the expectation. e.g.: https://hg.mozilla.org/integration/autoland/rev/b07579851b6f#l1.7
* there are not extra spaces on a blank line or at the end of a line, if there are they will be highlighted in red
* you are only editing one line in a file, not multiple lines on accident
* a chance to review your syntax and any comments


NOTE: the comment for the commit needs to follow the general pattern above.
== Making a patch ==
To actually disable a test, we need to update the manifest file in mozilla-central. Before doing that, create a patch using [https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html?highlight=moz-phab#mozilla-phabricator-user-guide moz-phab] containing the change and upload the patch to bugzilla for review.


=== Requesting review ===
For info about [https://github.com/mozilla-conduit/review/blob/master/README.md#installation installing] and [https://github.com/mozilla-conduit/review/blob/master/README.md#configuration configuring] moz-phab and implicitly arcanist see this [https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#setting-up-arcanist page]
In bugzilla, in the bug with [stockwell disable-recommended], use "Attach File" to attach your patch. Browse to find the patch in <your repo directory>/.hg/patches. Make sure you select "patch" for the Content Type. Then request review, "r?", and select a reviewer. In most cases, ask :gbrown or :jmaher for review.


In the above section it was suggested to copy your patch to ~/ via
After moz-phab setup you need to follow these steps to upload your patch to Phabricator:
  cp .hg/patches/bug1234567.patch ~/
nano/gedit file_path                                                                    //edit the file you want to disable
hg commit                                                                              //add commit message
  <inside editor add comment |Bug 1234567 - disable <test> for frequent failures. r=#intermittent-reviewers| and save>
hg diff -c .                                                                          //see the changes you made to the files and self review
moz-phab                                                                              //will submit the changes in phabricator


In doing this, you could easily find your patch when in bugzilla and looking to attach a file since it will be ~/bug1234567.patch.
If you want to update an existing phabricator patch, you need to be the owner of the revision or to [https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html?highlight=commandeer#other-revision-actions commandeer] it. Then do the following steps:


A few extra notes here:
moz-phab patch patch_id --apply-to .                        //applies the patch locally to the active repo (recommended mozilla-central)
* when uploading a patch the checkbox for "assign this bug to myself" is checked by default, uncheck this as you are just disabling a test
nano/gedit file_path                                        //edit the file you need to change
* use a description, not the patch nameSomething like: |disable test on <platforms>|
hg commit --amend                                          //update or change the commit
hg diff -c .                                               //see the changes you made to the files and self review
  moz-phab                                                    //upload the changes to phabricator


NOTE:
* The comment for the commit needs to follow the general pattern above: "Bug xxx - <patch description>. r=yyy"
* Phabricator automatically detects the reviewer from the commit message and asks for a review to the specified person.
* In most cases, for disable patches use r=gbrown or r=jmaher, except if you are disabling for webrender only, then use r=kats.
NOTE: the self review is a great time to make sure:
* there are not extra spaces on a blank line or at the end of a line, if there are they will be highlighted in red
* you are only editing one line in a file, not multiple lines on accident
* a chance to review your syntax and any comments


There are additional, generic instructions for getting Mozilla reviews at:
There are additional, generic instructions for getting Mozilla reviews at:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch


=== After the test is disabled ===
== After the test is disabled ==
* Check OrangeFactor to see if the patch was effective!
* Add leave-open to keyword and in Whiteboard change to [stockwell:disabled]
 
* "Watch" your patch landing to see if the patch was effective:
= Notes from email =
** Are there any new failures on your push, or on the next few pushes, of the disabled test?
Before disabling or when you don't disable:
* Or, check OrangeFactor (maybe the next day) to see if any new failures are reported.
* you have to read the history and see if anyone is working on it or trying to figure out the bug
* review recent bug history
** if there is a patch under review or comments indicate that a fix
is coming soon, consider postponing disabling
* look at the last 7 days in orange factor
** if no longer failing, mark [stockwell fixed]
** some examples:
** https://bugzilla.mozilla.org/show_bug.cgi?id=1420472
** https://bugzilla.mozilla.org/show_bug.cgi?id=1421775
** https://bugzilla.mozilla.org/show_bug.cgi?id=1423386 (fixed 2 days ago- recent comment and proved on graph)
 
* if it is a harness (i.e. not a clear test case in the title), then comment and stress the importance
** https://bugzilla.mozilla.org/show_bug.cgi?id=1391545
** https://bugzilla.mozilla.org/show_bug.cgi?id=1407383
**
 
if there are tests to disable we need to edit the manifests:
* What type of test is this and where is the manifest? ./mach test-info
* Which platforms are affected? opt/debug/both, os, other
* One time mercurial setup:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Mercurial
* Creating a patch and requesting review


We'll need separate guides to disabling syntax for:
== Special cases / getting help ==
* manifest parser
There are lots of "special cases" -- different types of tests, platform variations, and who knows what! If something seems odd, if you need more information, we're here to help: Ping/email :gbrown / :jmaher.
** mochitest.ini, browser.ini, chrome.ini, xpcshell.ini, a11y.ini
* reftest manifests
** reftest.list, crashtests.list
** use fuzzing if possible
* web-platform tests
** testing/web-platform
* autophone (easily confused with above .ini/.list manifests)

Latest revision as of 09:11, 12 December 2019

[stockwell disable-recommended]

When an intermittent-failure bug has recorded 150 or more failures in the last 21 days, the Orange Factor robot will change the bug's stockwell whiteboard tag to "[stockwell disable-recommended]". These bugs should be reviewed at least twice per week (current schedule is Monday and Thursday).

This page describes how to review [stockwell disable-recommended] bugs.

Finding bugs to disable

  • Use bugzilla to find all bugs with whiteboard tag "[stockwell disable-recommended]".
  • For each disable-recommended bug, determine if the bug can be addressed by disabling tests.
    • Ignore "meta" bugs or any bugs not related to a particular test, some examples:
    • Eliminate bugs that have been recently fixed.
      • Check 7-day history on OrangeFactor.
      • bug 1420472
      • bug 1421775
      • bug 1423386 (fixed 2 days ago- recent comment and proved on graph)
      • If there are no recent failures, perhaps the bug can be marked [stockwell fixed], [stockwell disabled] or [stockwell unknown].
    • Eliminate bugs with a patch under review, or coming very soon.
      • Review recent bug history.
      • If there is a patch under review or comments indicate that a fix is coming soon, consider postponing action on this bug.

Finding the manifest

For each test to be disabled, find the associated test manifest:

  • Search for the test name in searchfox or dxr, or,

Searchfox manifest.jpg

  • Run 'mach test-info --show-info <test-name>' in a mozilla-central check-out.
$ ./mach test-info --show-info browser/base/content/test/general/browser_ctrlTab.js
===== browser/base/content/test/general/browser_ctrlTab.js =====
Found browser\base\content\test\general\browser_ctrlTab.js in source control.
Build configuration changed. Regenerating backend.
browser\base\content\test\general\browser_ctrlTab.js found in manifest browser/base/content/test/general/browser.ini
  flavor: browser-chrome

In the above cases you would want to edit browser/base/content/test/general/browser.ini

$ pwd
$ /home/mozilla/mozilla-central
$ nano browser/base/content/test/general/browser.ini

Determining which platforms are affected

On OrangeFactor, check the detail view for the bug for the last 30 days. Look down the list of bugs for affected Platforms and Build Types. Does this test need to be disabled on all platforms, or only on some? For opt or debug builds, or both?

There are many reasons why a test might only fail on certain configs:

  • we don't run that test on a specific platform (for example devtools on android)
  • the test is skipped already on a configuration or platform

We typically have 4 platforms:

  • Linux (opt|debug|pgo|asan|ccov) - also bits (32|64)
  • OSX - (opt|debug) - only run on 10.10
  • Windows - (opt|debug|pgo|ccov) - also Windows 7|10
  • Android - (opt|debug) - x86|arm
    • no browser-chrome, devtools, web-platform-tests, and a few others

If the test is failing at least 5 times in the last 7 days on any given config, lets skip it. We cannot skip on pgo specifically, so that is opt (!debug). Often I try to make the skip syntax as simple as possible for simplicity sake and future editing. If we have:

[browser_sanity.js]
skip-if = (os == 'linux' && debug && bits == 64) || (os == 'linux' && !debug && bits == 64) || (os == 'osx' && !debug)

I would prefer to see:

[browser_sanity.js]
skip-if = (os == 'linux' && bits == 64) || (os == 'osx' && !debug)

If the test already had a skip if:

[browser_sanity.js]
skip-if = (os == 'win') # Bug 3141592 - timeout

we would end up with:

[browser_sanity.js]
skip-if = true # Bug 3141592, 271289

The reason for this is we would be skipping on linux/windows/osx, but not linux32 or android. Since this test doesn't run on Android, we would only be skipping on linux32 - and a test that only runs on 1 platform doesn't provide a lot of value unless it is platform specific.

Updating a manifest to disable a test

There are 3 different types of manifest files, each with a different format:

  • "ini" manifests like mochitest.ini, chrome.ini, browser.ini, xpcshell.ini
  • reftest or "list" manifests like reftest.list, crashtest.list
  • web-platform manifests in testing/web-platform/meta

ini manifests

  • In this type of manifest, add a "skip-if" statement under the test name -- on the next line.
[some_test.html]
skip-if = ...
  • Some examples of "skip-if":
skip-if = true                             # skip this test everywhere / always (test never runs)
skip-if = os == "android"                  # skip on Android only (continues to run on Linux, Windows, etc.)
                                           # other os strings: "win", "linux", "mac"
skip-if = debug                            # skip on all debug builds
skip-if = !debug                           # skip on all non-debug builds (opt, pgo)
skip-if = os == "android" || os == "linux" # skip on Android and skip on Linux
skip-if = os == "android" && debug         # skip on Android/Debug only (continues to run on Android/Opt)
  • For any test, there can only be one "skip-if" line. Often it is necessary to use || to expand the scope of a skip-if. For example, if a manifest already has:
[some_test.html]
skip-if = os == "android" || debug

but some_test.html is still failing on Windows/opt, it can be changed to:

[some_test.html]
skip-if = os == "android" || debug || os == "win"

reftest manifests

 skip-if(...) == some_test.html some_ref.html
  • Some examples of "skip-if":
skip-if(gtkWidget)                  # skip on Linux
skip-if(cocoaWidget)                # skip on Mac
skip-if(winWidget)                  # skip on Windows
skip-if(Android)                    # skip on Android
skip-if(isDebugBuild)               # skip on all Debug builds
skip-if(!isDebugBuild)              # skip on all non-Debug builds
skip-if(Android&&isDebugBuild)      # skip on Android/Debug

web-platform test manifests

web-platform tests are found in the mozilla-central repo under testing/web-platform/tests. These tests have their own, unique manifest format. Also, not all tests are listed in a manifest: A manifest is only created when a test needs to be skipped or otherwise annotated.

Manifests for web-platform tests are found in testing/web-platform/meta. The /meta directory structure parallels the /tests structure. For example testing/web-platform/meta/2dcontext/building-paths has manifests related to the tests in testing/web-platform/tests/2dcontext/building-paths.

When disabling a web-platform test, check to see if there is an existing manifest in the /meta directory for that test: If there is, modify the existing manifest as required; if not, add a new file (remember to add the new file to your patch with 'hg add').

Here's an example of a patch disabling testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html, on Linux and Windows 10/debug:

 diff --git a/testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html.ini b/testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html.ini
 new file mode 100644
 --- /dev/null
 +++ b/testing/web-platform/meta/content-security-policy/reporting/multiple-report-policies.html.ini
 @@ -0,0 +1,4 @@
 +[multiple-report-policies.html]
 +  disabled:
 +    if (os == "linux"): https://bugzilla.mozilla.org/show_bug.cgi?id=1435526
 +    if debug and (os == "win") and (version == "10.0.15063"): https://bugzilla.mozilla.org/show_bug.cgi?id=1435526

Making a patch

To actually disable a test, we need to update the manifest file in mozilla-central. Before doing that, create a patch using moz-phab containing the change and upload the patch to bugzilla for review.

For info about installing and configuring moz-phab and implicitly arcanist see this page

After moz-phab setup you need to follow these steps to upload your patch to Phabricator:

nano/gedit file_path                                                                    //edit the file you want to disable
hg commit                                                                              //add commit message
<inside editor add comment |Bug 1234567 - disable <test> for frequent failures. r=#intermittent-reviewers| and save>
hg diff -c .                                                                          //see the changes you made to the files and self review
moz-phab                                                                              //will submit the changes in phabricator

If you want to update an existing phabricator patch, you need to be the owner of the revision or to commandeer it. Then do the following steps:

moz-phab patch patch_id --apply-to .                        //applies the patch locally to the active repo (recommended mozilla-central)
nano/gedit file_path                                        //edit the file you need to change
hg commit --amend                                           //update or change the commit
hg diff -c .                                                //see the changes you made to the files and self review
moz-phab                                                    //upload the changes to phabricator

NOTE:

  • The comment for the commit needs to follow the general pattern above: "Bug xxx - <patch description>. r=yyy"
  • Phabricator automatically detects the reviewer from the commit message and asks for a review to the specified person.
  • In most cases, for disable patches use r=gbrown or r=jmaher, except if you are disabling for webrender only, then use r=kats.

NOTE: the self review is a great time to make sure:

  • there are not extra spaces on a blank line or at the end of a line, if there are they will be highlighted in red
  • you are only editing one line in a file, not multiple lines on accident
  • a chance to review your syntax and any comments

There are additional, generic instructions for getting Mozilla reviews at: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch

After the test is disabled

  • Add leave-open to keyword and in Whiteboard change to [stockwell:disabled]
  • "Watch" your patch landing to see if the patch was effective:
    • Are there any new failures on your push, or on the next few pushes, of the disabled test?
  • Or, check OrangeFactor (maybe the next day) to see if any new failures are reported.

Special cases / getting help

There are lots of "special cases" -- different types of tests, platform variations, and who knows what! If something seems odd, if you need more information, we're here to help: Ping/email :gbrown / :jmaher.