Closed Bug 1804170 Opened 3 years ago Closed 2 years ago

Intermittent comm/mail/components/extensions/test/browser/browser_ext_browserAction_popup_click.js | This test exceeded the timeout threshold.

Categories

(Thunderbird :: Add-Ons: Extensions API, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED
125 Branch

People

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

Details

(Keywords: intermittent-failure, intermittent-testcase)

Attachments

(2 files, 1 obsolete file)

Summary: Intermittent comm/mail/components/extensions/test/browser/browser_ext_browserAction_popup_click.js | single tracking bug → Intermittent comm/mail/components/extensions/test/browser/browser_ext_browserAction_popup_click.js | This test exceeded the timeout threshold.

We know we have issues with clicks on menu items and hiding menu popups
in the WebExtension tests. We currently mitigate these issues not only
in header files, but also directly in tests, and we also still have
places which are not using the mitigation (which could be the reason for
this intermittent).

While I still attempt to find the underlying cause for these issues,
this patch tries to unify the mitigation.

  1. Use the helper clickItemInMenuPopup() instead of manually calling
    menu.activateItem() in the tests themselves. The helper waits for the
    "popupHidden" event, which was not waited for in all places.

  2. Use the helper closeMenuPopup() instead of manually calling
    `menu.hidePopup() in the tests themselves. The helper waits for the
    "popupHidden" event, which was not waited for in all places.

  3. The function closeContextMenu() has been renamed to
    closeBrowserContextMenuPopup() and no longer accepts a menu
    parameter, but is now used only for the browserContext menu. If
    a specific menu should be closed, closeMenuPopup() should be used.

  4. The function closeExtensionContextMenu() has been renamed to
    clickItemInBrowserContextMenuPopup(), which better describes what it
    does.

Assignee: nobody → john
Status: NEW → ASSIGNED

Another reason why this type of test could fail: We are not waiting till
the popup is closed but use a timeout.

This patch uses the helper closeBrowserAction() in all places,
which waits for the "popuphidden" event.

It also increases readability by using the named event "popup closed".

In the browser_ext_browserAction_popup_focus.js test, the
wait-for-closed logic is moved from the extensions background to the
test itself, because it is much more stable this way.

Depends on D204760

This patch removes more arbitrary timeouts.

  1. After menu.activateItem() and menu.hidePopup(), wait for an animation
    frame instead of a fixed timeout.

  2. No longer wait 1s before closing the popup in the run_popup_test()
    function.

Depends on D204761

Attachment #9391458 - Attachment is obsolete: true

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/e6e1633e8d80
Unify clicks on menu items and hiding menu popups. r=mkmelin
https://hg.mozilla.org/comm-central/rev/3225ec8e3846
Properly wait for action popups being closed. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: