Intermittent browser/components/extensions/test/browser/browser_ext_popup_focus.js | single tracking bug
Categories
(WebExtensions :: General, defect, P5)
Tracking
(Not tracked)
People
(Reporter: intermittent-bug-filer, Unassigned, NeedInfo)
References
Details
(Keywords: intermittent-failure, intermittent-testcase, Whiteboard: [stockwell][stockwell unknown])
Attachments
(2 files, 1 obsolete file)
![]() |
||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment 5•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
![]() |
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
![]() |
||
Updated•7 years ago
|
Comment 13•7 years ago
|
||
Updated•7 years ago
|
Comment 14•7 years ago
|
||
bugherder |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Updated•7 years ago
|
Comment 17•6 years ago
|
||
Updated•5 years ago
|
Comment 18•4 years ago
|
||
fully disabled test
Comment 19•4 years ago
|
||
Comment 20•4 years ago
|
||
I took a look into this, the test case was intermittent also for me locally (on a linux64 opt artifact build) and for me the test task related to the browserAction wasn't failing anymore if I remove the part that opens a new tab, which makes me suspect that the tab being loaded may have been intermittently stealing the focus that the browserAction popup does expect.
I attached the changes I applied locally (which also include some additional calls to browser.test.log
to make it slightly clearer based just on the logs where the test got stuck) and pushed to try here:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=4162a2b72dde29f13514e8b8f34413b43bc28640
Let's see how it goes in the try push, if it looks green enough I'll open the phabricator revision for review (I currently marked it as work-in-progress to defer a review to once we have verified if it does help also when the test runs on the build infrastructure as it did locally).
Comment 21•4 years ago
|
||
The test seems to be still failing in the linux-opt webrender TV job from time to time, but I'm not sure that the intermittency rate is as high as it used to be when the test has been disabled on all platforms and build types (e.g. I tried to rerun the linux opt and linux debug TV jobs a bunch of times and it did never fail).
Nevertheless the fact that I does still fail intermittently in webrender (and I can reproduce that locally too, not that often but often enough) makes me think that there is still some kind of race that we are able to trigger with this test.
I haven't been able to record a failure with rr yet, but I did:
- run the test with the addition of
MOZ_LOG="Focus:5"
- then compared the nsFocusManager logs emitted when the test pass just fine with the ones emitted when the test get stuck because we never get the "focus" event on the extension popup side and fails for a timeout
Based on those logs I got the impression that we may be early exiting from the nsFocusManager::SetFocusInner
method and so I looked a bit into what we are doing inside that method and there is an inline comment that looked suspicious (quoting it from here):
// XXX This is wrong for `<iframe mozbrowser>` and for XUL
// `<browser remote="true">`. See:
// https://searchfox.org/mozilla-central/rev/8a63fc190b39ed6951abb4aef4a56487a43962bc/dom/base/nsFrameLoader.cpp#229-232
I'm not 100% sure yet if we are actually hitting that part and if it is part of what is triggering the issue, I'm going to give a look next asap.
Updated•4 years ago
|
Comment 22•4 years ago
|
||
After looking more deeply into the intermittent behavior (and having to resort to some "printf debugging" to get some additional trace logs to figure out what was happening when the panel wasn't focused) I think that I have figure out the actual underlying issue:
-
when the panel isn't focused,
nsFocusManager::SetFocus
is early exiting before it would actually focus the panel, because the popup frame is detected to still have view visibility set tonsViewVisibility_kHide
. -
The popup frame visibility is set to
nsViewVisibility_kShow
bynsMenuPopupFrame::LayoutPopup
-
when the test pass successfully (and the popup panel focused as expected):
nsMenuPopupFrame::LayoutPopup
did set the visibility tonsViewVisibility_kShow
- then "Extension:GrabFocus" message is sent to the panel (from ExtensionPopups.jsm)
- and finaly
nsFocusManager::SetFocus
is being called in response toServices.focus.focusWindow = content.window;
(from ext-browser-content.js handler for the "Extension:GrabFocus" message)
-
when the test gets stuck and fails (and the popup panel is never focused):
- "Extension:GrabFocus" message is sent to the panel (from ExtensionPopups.jsm)
nsFocusManager::SetFocus
is being called in response toServices.focus.focusWindow = content.window;
nsMenuPopupFrame::LayoutPopup
did set the visibility tonsViewVisibility_kShow
too late and the panel doesn't grab the focus
To fix the intermittency, we could explicitly wait for the chrome document to be fully flushed before sending the "Extension:GrabFocus" message (from ExtensionPopups.jsm).
I've applied this change and the test file was finally passing consistenty with --verify (with and without WebRender enabled), as I was expecting given the analysis described above.
I've just updated the patch accordingly (the changes to the test file should now be purely readability changes, they shouldn't have an impact on the intermittency in practice).
Let's double-check that a new push to try that this version of the patch is making the test stable also when running on the build infrastructure:
Comment 23•4 years ago
|
||
Comment 24•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Updated•4 years ago
|
Comment 25•4 years ago
|
||
Closing as fixed, it doesn't seem we got any new occurrence of this intermittent from when we re-enabled the test one week ago. This can be re-opened if that will happen again in the near future.
Comment 26•3 years ago
|
||
Recent failure log: https://treeherder.mozilla.org/logviewer?job_id=358664752&repo=autoland&lineNumber=32472
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Updated•2 years ago
|
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment 69•2 years ago
|
||
Lowering to P5/S4 (priority was bumped to P2 in comment 18 because the test was disabled in all builds and jobs (got enabled back in 24, it does fail intermittently bug apparently it didn't raise in intermittency too much over the last year).
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Updated•2 years ago
|
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment 88•2 years ago
|
||
There have been 32 total failures in the last 7 days.
There are:
- 4 failures on linux1804-64-qropt and debug
- 28 failures on macosx1015-64-qr debug
Recent failure log.
Tomislav, as the owner of this component, can you help us assign the bug to someone? Thank you.
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Description
•