Sheriffing/How To/Intermittent bugs: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
m (ChrisCooper moved page Sheriffing/How:To:Intermittent-bugs to Sheriffing/How To/Intermittent bugs: More intuitive naming scheme)
(added identification fo bugzilla product and component with |./mach file-info| to bug filing how-to)
Line 8: Line 8:
= How to file a bug for an intermittent failure =
= How to file a bug for an intermittent failure =


If there's no bug on file, you'll need to file one. The are two requirements need to be included in the bug that this bug can be displayed automatically by Treeheder when this intermittent failure happens again:
If there's no bug on file, you'll need to file one.
 
== Bugfiler ==
If bugfiler isn't automatically enabled for you, you can add <code>&bugfiler</code> to the Treeherder url, e.g. https://treeherder.mozilla.org/#/jobs?repo=autoland&bugfiler This activates bugfiler (the little bug icon beside a failure) that automates most of the manual steps from the previous section.
 
The are two requirements need to be included in the bug that this bug can be displayed automatically by Treeheder when this intermittent failure happens again:


# In the summary: '''Intermittent''' test_file test failure
# In the summary: '''Intermittent''' test_file test failure
# In the Keyword field choose the keyword: '''intermittent-failure'''
# In the Keyword field choose the keyword: '''intermittent-failure'''


== Example ==
== Manually filing a bug ==


Lets imagine you have a test failure like <code>TEST-UNEXPECTED-TIMEOUT | /navigation-timing/test_timing_xserver_redirect.html | expected OK</code> in Treeherder and there is no bug on file for this failure.  
Lets imagine there are issues with bugfiler or you can't use it for other reasons (e.g. security sensitive bug which should not be public) and you have a test failure like <code>TEST-UNEXPECTED-TIMEOUT | /navigation-timing/test_timing_xserver_redirect.html | expected OK</code> in Treeherder and there is no bug on file for this failure.  


# Open the Treeherder Log
# Open the Treeherder Log
# Login into Bugzilla in a different tab/window
# Login into Bugzilla in a different tab/window
# Find the Product/Component where you need to file this bug (note: dxr and hg.mozilla.org can be very helpful if you are in doubt)
# Find the Product/Component where you need to file this bug (note: dxr and hg.mozilla.org can be very helpful if you are in doubt)
#* In this example the Bug belong to Core:Document Navigation
## Copy the file path from the failure line <code>/navigation-timing/test_timing_xserver_redirect.html</code>
## Find it in the repository, either with the search term 'path:/navigation-timing/test_timing_xserver_redirect.html' on [https://dxr.mozilla.org/mozilla-central/source/ DXR] or '/navigation-timing/test_timing_xserver_redirect.html' in the right path filter field of [http://searchfox.org/ searchfox].
## Copy the full folder and file path, e.g. <code>testing/web-platform/tests/navigation-timing/test_timing_xserver_redirect.html</code>
## In the console with the mozilla-unified folder, run the following command to get the Bugzilla product and component in which bugs related to the file should be posted:<br>
<code>./mach file-info bugzilla-component testing/web-platform/tests/navigation-timing/test_timing_xserver_redirect.html</code><br>
In this case, we get: <code>Core :: DOM<br>
testing/web-platform/tests/navigation-timing/test_timing_xserver_redirect.html</code>
# Copy the failure text from the log window into the bug  
# Copy the failure text from the log window into the bug  
# Set the Summary as: Intermittent navigation-timing/test_timing_xserver_redirect.html | expected OK
# Set the Summary as: Intermittent navigation-timing/test_timing_xserver_redirect.html | expected OK
Line 29: Line 40:


Treeherder syncs with Bugzilla several times a day. Once your bug is added and the systems sync, Treeherder will suggest your new bug as a match for the next intermittent failure of this type.
Treeherder syncs with Bugzilla several times a day. Once your bug is added and the systems sync, Treeherder will suggest your new bug as a match for the next intermittent failure of this type.
= Bugfiler =
You can add <code>%bugfiler</code> to the Treeherder url, e.g. https://treeherder.mozilla.org/#/jobs?repo=autoland&bugfiler This activates bugfiler (the little bug icon beside a failure) that automates most of the manual steps from the previous section.

Revision as of 16:23, 6 November 2017

When you find a test that fails more than once, but not every time, congratulations, you've uncovered an intermittent failure. This is the most annoying class of failures for both sheriffs and developers because it is not necessarily related to the code under test, but more likely indicates that the test itself might need to change to improve stability.

The test failure may have happened before and a bug may already be on file. In such cases, Treeherder should suggest the bug number and title under the failure, e.g.:

Treeherder suggestions

How to file a bug for an intermittent failure

If there's no bug on file, you'll need to file one.

Bugfiler

If bugfiler isn't automatically enabled for you, you can add &bugfiler to the Treeherder url, e.g. https://treeherder.mozilla.org/#/jobs?repo=autoland&bugfiler This activates bugfiler (the little bug icon beside a failure) that automates most of the manual steps from the previous section.

The are two requirements need to be included in the bug that this bug can be displayed automatically by Treeheder when this intermittent failure happens again:

  1. In the summary: Intermittent test_file test failure
  2. In the Keyword field choose the keyword: intermittent-failure

Manually filing a bug

Lets imagine there are issues with bugfiler or you can't use it for other reasons (e.g. security sensitive bug which should not be public) and you have a test failure like TEST-UNEXPECTED-TIMEOUT | /navigation-timing/test_timing_xserver_redirect.html | expected OK in Treeherder and there is no bug on file for this failure.

  1. Open the Treeherder Log
  2. Login into Bugzilla in a different tab/window
  3. Find the Product/Component where you need to file this bug (note: dxr and hg.mozilla.org can be very helpful if you are in doubt)
    1. Copy the file path from the failure line /navigation-timing/test_timing_xserver_redirect.html
    2. Find it in the repository, either with the search term 'path:/navigation-timing/test_timing_xserver_redirect.html' on DXR or '/navigation-timing/test_timing_xserver_redirect.html' in the right path filter field of searchfox.
    3. Copy the full folder and file path, e.g. testing/web-platform/tests/navigation-timing/test_timing_xserver_redirect.html
    4. In the console with the mozilla-unified folder, run the following command to get the Bugzilla product and component in which bugs related to the file should be posted:

./mach file-info bugzilla-component testing/web-platform/tests/navigation-timing/test_timing_xserver_redirect.html
In this case, we get: Core :: DOM
testing/web-platform/tests/navigation-timing/test_timing_xserver_redirect.html

  1. Copy the failure text from the log window into the bug
  2. Set the Summary as: Intermittent navigation-timing/test_timing_xserver_redirect.html | expected OK
  3. In the keyword field choose intermittent-failure
  4. Submit the bug

The bug should look like https://bugzilla.mozilla.org/show_bug.cgi?id=1172135

Treeherder syncs with Bugzilla several times a day. Once your bug is added and the systems sync, Treeherder will suggest your new bug as a match for the next intermittent failure of this type.