Skip to content

Commit

Permalink
[wdspec] Wait for 100ms in release_actions fixture
Browse files Browse the repository at this point in the history
This allows to avoid relatively frequent failures on mozilla's windows CI

Differential Revision: https://phabricator.services.mozilla.com/D209333

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1879556
gecko-commit: 60bd84a99544c65635a66686db7aeda2500e6ae9
gecko-reviewers: webdriver-reviewers, whimboo
  • Loading branch information
juliandescottes authored and moz-wptsync-bot committed May 22, 2024
1 parent bbc2389 commit 8463bfd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions webdriver/tests/classic/perform_actions/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import time

from webdriver.error import NoSuchWindowException

Expand Down Expand Up @@ -59,10 +60,21 @@ def wheel_chain(session):


@pytest.fixture(autouse=True)
def release_actions(session, request):
def release_actions(session):
# release all actions after each test
# equivalent to a teardown_function, but with access to session fixture
request.addfinalizer(session.actions.release)
yield

# Avoid frequent intermittent failures on Mozilla Windows CI with
# perform_actions tests:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1879556
if (
session.capabilities["browserName"] == "firefox"
and session.capabilities["platformName"] == "windows"
):
time.sleep(0.1)

session.actions.release()


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion webdriver/tests/support/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def full_configuration():
host - WebDriver server host.
port - WebDriver server port.
capabilites - Capabilites passed when creating the WebDriver session
capabilities - Capabilities passed when creating the WebDriver session
timeout_multiplier - Multiplier for timeout values
webdriver - Dict with keys `binary`: path to webdriver binary, and
`args`: Additional command line arguments passed to the webdriver
Expand Down

0 comments on commit 8463bfd

Please sign in to comment.