Open Bug 1686769 Opened 4 years ago Updated 2 years ago

Investigate timeout on linux in test_sendkeys_menupopup_chrome.py

Categories

(Testing :: Marionette Client and Harness, task, P3)

Default
Unspecified
Linux
task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

When creating test_sendkeys_menupopup_chrome.py in Bug 1685291 we added a retry mechanism to avoid test timeouts when trying to open the context menu.

Each test in this files goes through the following setup:

    def setUp(self):
        super(TestSendkeysMenupopup, self).setUp()

        self.marionette.set_context("chrome")
        new_window = self.open_chrome_window(
            "chrome://marionette/content/test_menupopup.xhtml"
        )
        self.marionette.switch_to_window(new_window)

test_menupopup.xhtml simply contains a button associated to a popup.
Clicking on the button should display the popup.

However, from time to time, the button click doesn't trigger the popup to open, only on Linux. In those cases, we click on the button again, but it would be good to know why this occurs.

See also review comment https://phabricator.services.mozilla.com/D101152#inline-571380 for additional context.

Olli, any idea why a click onto that button might fail for chrome documents right after opening the window? Maybe the DOM wasn't ready at that time yet? Any suggestions in how to figure that out?

Flags: needinfo?(bugs)

Flush the layout before the click?
Or is it possible the issue is somehow related to the window manager in the linux,
Is marionette.switch_to_window() ensuring the window is actually in the foreground properly?

Flags: needinfo?(bugs)

We indeed had / have issues with the window manager on Linux mostly caused by its asynchronicity. I can actually remember test failures for focusing. I would have to check where exactly that happened.

Here is the code that we use to focus the window:
https://searchfox.org/mozilla-central/rev/bd92b9b4a3c2ff022e830c1358968a84e6e69c95/testing/marionette/browser.js#291-300

Marionette awaits the focus and activated events.

The problem that I mentioned in my last comment is actually only happening with background windows. See bug 1511970. But opening this chrome window happens in foreground. So it's not related.

Product: Testing → Remote Protocol
Component: Marionette → Marionette Client and Harness
Product: Remote Protocol → Testing
You need to log in before you can comment on or make changes to this bug.