Closed Bug 1378104 Opened 9 years ago Closed 23 days ago

Intermittent browser/components/extensions/test/browser/test-oop-extensions/browser_ext_commands_execute_page_action.js | Test timed out -

Categories

(WebExtensions :: Untriaged, defect)

defect

Tracking

(firefox157 fixed)

RESOLVED FIXED
157 Branch
Tracking Status
firefox157 --- fixed

People

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

References

(Blocks 2 open bugs)

Details

(Keywords: bulk-close-intermittents, intermittent-failure)

Attachments

(2 files)

Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Recent failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=169688618&repo=autoland&lineNumber=1500 09:54:04 INFO - GECKO(1859) | [Parent 1859, StreamTrans #16] WARNING: 'NS_FAILED(rv)', file /builds/worker/workspace/build/src/modules/libjar/nsJARChannel.cpp, line 428 09:54:04 INFO - GECKO(1859) | --DOMWINDOW == 1 (0x122677400) [pid = 1865] [serial = 1] [outer = 0x0] [url = about:blank] 09:54:04 INFO - GECKO(1859) | --DOMWINDOW == 3 (0x11fe9a800) [pid = 1863] [serial = 4] [outer = 0x0] [url = about:blank] 09:54:04 INFO - GECKO(1859) | --DOMWINDOW == 2 (0x118a7fc00) [pid = 1863] [serial = 3] [outer = 0x0] [url = about:blank] 09:54:05 INFO - GECKO(1859) | --DOMWINDOW == 1 (0x11ba55000) [pid = 1866] [serial = 1] [outer = 0x0] [url = http://example.com/] 09:54:07 INFO - GECKO(1859) | --DOMWINDOW == 0 (0x12267b400) [pid = 1865] [serial = 2] [outer = 0x0] [url = about:blank] 09:54:08 INFO - GECKO(1859) | 2018-03-22 09:54:08.944 firefox[1859:9627] Persistent UI failed to open file file:///Users/cltbld/Library/Saved%20Application%20State/org.mozilla.nightlydebug.savedState/window_1.data: No such file or directory (2) 09:54:09 INFO - GECKO(1859) | --DOMWINDOW == 0 (0x122edb000) [pid = 1866] [serial = 3] [outer = 0x0] [url = http://example.com/] 09:55:21 INFO - TEST-INFO | started process screencapture 09:55:21 INFO - TEST-INFO | screencapture: exit 0 09:55:21 INFO - Buffered messages logged at 09:53:51 09:55:21 INFO - Entering test bound test_execute_page_action_without_popup 09:55:21 INFO - Extension loaded 09:55:21 INFO - Console message: 1521737631501 addons.webextension.{c0d6b931-5a38-434a-82ae-cf46e93fe70d} WARN Please specify whether you want browser_style or not in your page_action options. 09:55:21 INFO - Buffered messages logged at 09:53:52 09:55:21 INFO - Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/FileUtils.jsm" line: 170}] 09:55:21 INFO - Buffered messages finished 09:55:21 INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_commands_execute_page_action.js | Test timed out - 09:55:21 INFO - Not taking screenshot here: see the one that was previously logged 09:55:21 INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_commands_execute_page_action.js | Extension left running at test shutdown - 09:55:21 INFO - Stack trace: 09:55:21 INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:109 09:55:21 INFO - chrome://mochikit/content/browser-test.js:Tester.prototype.nextTest<:675 09:55:21 INFO - timeoutFn@chrome://mochikit/content/browser-test.js:1171:9 09:55:21 INFO - setTimeout handler*Tester_execTest@chrome://mochikit/content/browser-test.js:1133:9 09:55:21 INFO - Tester.prototype.nextTest</<@chrome://mochikit/content/browser-test.js:962:9 09:55:21 INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:795:59 09:55:21 INFO - GECKO(1859) | MEMORY STAT | vsize 4372MB | residentFast 358MB | heapAllocated 80MB 09:55:21 INFO - TEST-OK | browser/components/extensions/test/browser/browser_ext_commands_execute_page_action.js | took 90096ms 09:55:21 INFO - GECKO(1859) | ++DOCSHELL 0x1202b6000 == 1 [pid = 1865] [id = {0bc86bff-9916-ad44-8a74-f77f36d87578}] 09:55:21 INFO - GECKO(1859) | ++DOMWINDOW == 1 (0x12266d400) [pid = 1865] [serial = 3] [outer = 0x0] 09:55:21 INFO - checking window state 09:55:21 INFO - GECKO(1859) | ++DOMWINDOW == 2 (0x122677800) [pid = 1865] [serial = 4] [outer = 0x12266d400] 09:55:21 INFO - GECKO(1859) | ++DOMWINDOW == 13 (0x10d865c00) [pid = 1859] [serial = 40] [outer = 0x12b985000] 09:55:21 INFO - GECKO(1859) | ++DOMWINDOW == 14 (0x11a734800) [pid = 1859] [serial = 41] [outer = 0x12b985000] 09:55:21 INFO - GECKO(1859) | --DOCSHELL 0x11bf0f000 == 0 [pid = 1868] [id = {838eda4a-a2ee-2e41-a0ec-2c139d2767fc}] 09:55:21 INFO - GECKO(1859) | --DOMWINDOW == 1 (0x115855400) [pid = 1868] [serial = 1] [outer = 0x0] [url = about:blank] 09:55:21 INFO - GECKO(1859) | --DOMWINDOW == 0 (0x115859400) [pid = 1868] [serial = 2] [outer = 0x0] [url = about:blank] 09:55:21 INFO - GECKO(1859) | --DOCSHELL 0x11fa52800 == 0 [pid = 1863] [id = {26399342-9884-c941-9362-f8e97e7c08bc}] 09:55:22 INFO - GECKO(1859) | --DOMWINDOW == 1 (0x11fe9bc00) [pid = 1863] [serial = 5] [outer = 0x0] [url = about:newtab] 09:55:22 INFO - GECKO(1859) | --DOMWINDOW == 0 (0x11fa75000) [pid = 1863] [serial = 7] [outer = 0x0] [url = about:newtab] 09:55:22 INFO - GECKO(1859) | --DOCSHELL 0x12e926000 == 5 [pid = 1859] [id = {064941af-782f-9344-9cba-80cd3f2c9c5a}] 09:55:24 INFO - GECKO(1859) | --DOCSHELL 0x12eb56800 == 4 [pid = 1859] [id = {fd1e1ac5-acb4-b747-9380-d1ce18212d23}] 09:55:24 INFO - GECKO(1859) | --DOMWINDOW == 13 (0x12d42e000) [pid = 1859] [serial = 8] [outer = 0x0] [url = about:blank] 09:55:24 INFO - GECKO(1859) | --DOMWINDOW == 12 (0x10d865c00) [pid = 1859] [serial = 40] [outer = 0x0] [url = about:blank] 09:55:24 INFO - GECKO(1859) | Completed ShutdownLeaks collections in process 1868 09:55:24 INFO - GECKO(1859) | Completed ShutdownLeaks collections in process 1866 09:55:24 INFO - GECKO(1859) | Completed ShutdownLeaks collections in process 1865 09:55:24 INFO - GECKO(1859) | Completed ShutdownLeaks collections in process 1863 09:55:25 INFO - GECKO(1859) | --DOMWINDOW == 11 (0x12eaa6c00) [pid = 1859] [serial = 37] [outer = 0x0] [url = moz-extension://6c3ee8ee-b1e1-f746-b07b-9e5819b7f5a8/_generated_background_page.html] 09:55:25 INFO - GECKO(1859) | --DOMWINDOW == 10 (0x12eaa5c00) [pid = 1859] [serial = 36] [outer = 0x0] [url = chrome://extensions/content/dummy.xul] 09:55:25 INFO - GECKO(1859) | --DOMWINDOW == 9 (0x12eaa3c00) [pid = 1859] [serial = 33] [outer = 0x0] [url = chrome://extensions/content/dummy.xul] 09:55:25 INFO - GECKO(1859) | --DOMWINDOW == 8 (0x12eaab800) [pid = 1859] [serial = 39] [outer = 0x0] [url = moz-extension://6c3ee8ee-b1e1-f746-b07b-9e5819b7f5a8/_generated_background_page.html] 09:55:28 INFO - GECKO(1859) | Completed ShutdownLeaks collections in process 1859 09:55:28 INFO - TEST-START | Shutdown
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 9 years ago → 8 years ago
Resolution: --- → INCOMPLETE
Product: Toolkit → WebExtensions
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Severity: normal → S3
Status: REOPENED → RESOLVED
Closed: 8 years ago → 1 year ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 1 year ago → 1 year ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 1 year ago → 11 months ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---

browser_ext_commands_execute_page_action.js fails with "uncaught
rejection: PageActions: No anchor node for <uuid>", and then every one
of the 44 tests that follow it in browser.toml fails "waiting for vsync to
be disabled". That is 2,729 failures per 21 days, 38% of all failures in
browser/components/extensions/test/browser.

Two defects combine.

BrowserPageActions.panelAnchorNodeForAction() has no candidate it can rely
on. It measures candidates with getBoundsWithoutFlushing(), so a node that
was just inserted and has no frame yet measures 0x0 and is skipped, and on
an ordinary page none of the other candidates is usable either:
#pageActionButton is display:none above 680px, and the
browser.urlbar.trustPanel featureGate hides the #identity-icon-box that
contains #identity-icon for pageproxystate="valid" non-chrome pages. So it
throws. pageAction makes that reachable: pageAction.show() defers the
setDisabled(false) that places the button in the urlbar to
requestAnimationFrame, while handleClick() creates the popup, awaits its
contentReady and then anchors to that button, so on a machine with a
starved refresh driver the button is either not there yet or not laid out
yet. Append #urlbar, which is always present and laid out, as a last
resort. Flushing layout in the anchor lookup would be a worse fix: it is a
shared getter, also called by BookmarkingUI.anchor, and none of its
callers wants a synchronous reflow.

The throw happens after the PanelPopup has been created, leaving a panel
that is never shown and therefore never hidden, because BasePopup.close()
awaits promisePopupShown first. Its browser stays alive with its refresh
driver ticking, so the parent keeps sending vsync and
ChromeUtils.vsyncEnabled() never goes false again - which is what the
following tests trip over. Destroy the popup if anchoring throws anyway.

Also apply the pending button update synchronously before creating the
popup. This does not close the race - a node inserted without a layout
flush still measures 0x0 - but it removes the case where the node is
missing altogether, so that the popup anchors to its own button rather
than to the urlbar.

This patch holds its own popup in a local so its cleanup is correct even
if a second activation replaces this.popupNode, but it does not close that
hole: two activations in one turn still orphan a panel, which is a
separate defect.

Assignee: nobody → florian
Blocks: 2062142
Blocks: 2013250

This test extension complements my review to the patch at https://phabricator.services.mozilla.com/D317513 . The extension can be used to open the page action panel on demand, via a button in the shown extension page, or via the Ctrl+Shift+U shortcut.

STR:

  1. Visit about:debugging and load the attached extension.
  2. Open the Browser Console (Ctrl+Shift+J or Cmd+Shift+J).
  3. The extension opened a page, showing buttons to open a new window, with and without urlbar, and a button to open the popup panel if needed.

Normal behavior:

  1. Click on the "pageAction.openPopup()" button (or Ctrl+Shift+U).
  2. Result: pageAction popup panel opens, no errors in Browser Console.

PageAction button not shown by extension:

  1. Open new tab (about:newtab)
  2. Press Ctrl+Shift+U.
  3. Result: pageAction popup panel does not open; Browser Console shows no errors - expected.

urlbar not visible:

  1. Click on the browser.windows.create({ type: "popup" }) button. This opens a window without urlbar.
  2. Press Ctrl+Shift+U.
  3. Result: pageAction popup panel does not open; Browser Console shows error: Error: PageActions: No anchor node for _7937a0b1-9c04-4895-a00f-712581f98c06_

urlbar edited (automatically hides pageAction button):

  1. Edit the URL in the address bar. This hides the pageAction button.
  2. Press Ctrl+Shift+U to try to open the pageAction popup panel.
  3. Result:
  • Current (pre-patch): pageAction popup does not open; Browser Console shows error: Error: PageActions: No anchor node for _7937a0b1-9c04-4895-a00f-712581f98c06_
  • Current patch (https://phabricator.services.mozilla.com/D317513?id=1358568): pageAction popup panel opens underneath address bar (due to fallback to #urlbar), pageAction button still not visible.
Attachment #9624804 - Attachment description: Bug 1378104 - Give page action popups an anchor they can always use, and destroy the popup when anchoring fails, r=#extension-reviewers. → Bug 1378104 - Wait for the page action button to be laid out before triggering _execute_page_action, and destroy the popup when anchoring fails, r=#extension-reviewers.
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fdf2baf6d9a5 https://hg.mozilla.org/integration/autoland/rev/d60431c361ee Wait for the page action button to be laid out before triggering _execute_page_action, and destroy the popup when anchoring fails, r=extension-reviewers,robwu.
Status: REOPENED → RESOLVED
Closed: 11 months ago → 23 days ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: