Closed Bug 1441507 Opened 2 years ago Closed 2 years ago

Intermittent devtools/startup/tests/browser/browser_shim_disable_devtools.js | Test timed out -

Categories

(DevTools :: General, defect, P2)

defect

Tracking

(firefox-esr60 fixed, firefox60 wontfix, firefox61 fixed, firefox62 fixed)

RESOLVED FIXED
Firefox 62
Tracking Status
firefox-esr60 --- fixed
firefox60 --- wontfix
firefox61 --- fixed
firefox62 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: jdescottes)

References

Details

(Keywords: intermittent-failure, Whiteboard: [stockwell fixed:other])

Attachments

(1 file)

Duplicate of this bug: 1449117
Summary: Intermittent devtools/shim/tests/browser/browser_shim_disable_devtools.js | Test timed out - → Intermittent devtools/startup/tests/browser/browser_shim_disable_devtools.js | Test timed out -
I think this intermittent has been introduced by bug 1444033, I started seeing it in the related try push.
But don't ask me why it relates to this test, this is still very mysterious to me.
In the last 7 days, there have been 30 failures.

All of the failures are on OS X 10.10, but also some of them on Linux x64.
Affected build types: debug, opt.

An example of a recent log file:
https://treeherder.mozilla.org/logviewer.html#?repo=autoland&job_id=176397811&lineNumber=19026

And the relevant part of the log:
20:12:08     INFO - TEST-PASS | devtools/startup/tests/browser/browser_shim_disable_devtools.js | The current tab is not about:devtools - 
20:12:08     INFO - Open the context menu for the content page.
20:12:08     INFO - Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/FileUtils.jsm" line: 170}]
20:12:08     INFO - Buffered messages finished
20:12:08     INFO - TEST-UNEXPECTED-FAIL | devtools/startup/tests/browser/browser_shim_disable_devtools.js | Test timed out - 
20:12:08     INFO - GECKO(1989) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
20:12:08     INFO - GECKO(1989) | MEMORY STAT | vsize 4372MB | residentFast 331MB | heapAllocated 86MB
20:12:08     INFO - TEST-OK | devtools/startup/tests/browser/browser_shim_disable_devtools.js | took 90131ms
20:12:08     INFO - GECKO(1989) | ++DOCSHELL 0x112427800 == 1 [pid = 1994] [id = {d1151e8c-f0d4-7945-840c-616f7af5b1e7}]
20:12:08     INFO - GECKO(1989) | ++DOMWINDOW == 1 (0x11c7ecc00) [pid = 1994] [serial = 1] [outer = 0x0]
20:12:08     INFO - checking window state
20:12:08     INFO - Not taking screenshot here: see the one that was previously logged
20:12:08     INFO - TEST-UNEXPECTED-FAIL | devtools/startup/tests/browser/browser_shim_disable_devtools.js | Found a browser window after previous test timed out - 
20:12:08     INFO - GECKO(1989) | must wait for focus
20:12:08     INFO - GECKO(1989) | ++DOMWINDOW == 2 (0x122fcc000) [pid = 1994] [serial = 2] [outer = 0x11c7ecc00]
20:12:08     INFO - GECKO(1989) | ++DOMWINDOW == 15 (0x11a037400) [pid = 1989] [serial = 21] [outer = 0x113530800]
20:12:08     INFO - GECKO(1989) | ++DOMWINDOW == 16 (0x11a036400) [pid = 1989] [serial = 22] [outer = 0x113530800]

:pbro As you are the triage owner of this component, could you please take a look at this?
Thank you!
Flags: needinfo?(pbrosset)
Whiteboard: [stockwell needswork]
Bumping the priority, and putting on Julian's radar. 
Julian, if you don't have time for this one now, please let me know.
Flags: needinfo?(pbrosset) → needinfo?(jdescottes)
Priority: P5 → P2
It seems that increasing the pause before we try to open the menu reduces the frequency of failures:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=62a64b892018bdc5c0d54c13e859667a8fd474f1

That means we must be missing an event telling us that the window is ready to be used. Maybe the window is loaded, but not focused yet, so the click doesn't go through as expected. Keeping the ni? for now.
Comment on attachment 8973290 [details]
Bug 1441507 - Fix window focus issue for intermittent browser_shim_disable_devtools;

https://reviewboard.mozilla.org/r/241758/#review247606


Code analysis found 1 defect in this patch:
 - 1 defect found by mozlint

You can run this analysis locally with:
 - `./mach lint path/to/file` (JS/Python)


If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: devtools/startup/tests/browser/browser_shim_disable_devtools.js:104
(Diff revision 1)
>    } else {
>      EventUtils.synthesizeKey("i", { accelKey: true, shiftKey: true }, win);
>    }
>  }
> +
> +function waitUntil(predicate, interval = 10) {

Error: 'waituntil' is defined but never used. [eslint: no-unused-vars]
The current patch seems to fix the issue:
- with fix: 0 failure in ~30 runs: https://treeherder.mozilla.org/#/jobs?repo=try&revision=054db7f188061ba651f1a6ea0e60dd681f56c924&selectedJob=177034330
- without fix: 7 failures in ~30 runs: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a1ae41ca7b29a9d97c11723dc7a48c304e2be486&selectedJob=177034373

I couldn't find an explicit way to wait for the window to have the focus. Tried various combinations of waitForFocus or similar methods, nothing worked. Loading a new tab in it and waiting for it to be loaded seems to ensure the window has the focus, so going with that for now.
Flags: needinfo?(jdescottes)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Comment on attachment 8973290 [details]
Bug 1441507 - Fix window focus issue for intermittent browser_shim_disable_devtools;

https://reviewboard.mozilla.org/r/241758/#review247838
Attachment #8973290 - Flags: review?(pbrosset) → review+
Thanks for the review!
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b697efa82765
Fix window focus issue for intermittent browser_shim_disable_devtools;r=pbro
https://hg.mozilla.org/mozilla-central/rev/b697efa82765
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
Whiteboard: [stockwell needswork] → [stockwell fixed:other]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.