Skip to content

Commit cc5a6c7

Browse files
committed
Add more retries to failing tests
1 parent 047dec1 commit cc5a6c7

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

tests/selenium/content_filtering_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_blocking(self):
5252
self.assert_block()
5353

5454
# TODO sporadic "Cookie fixture should have set a cookie" failures
55-
@pytest.mark.flaky(reruns=3)
55+
@pytest.mark.flaky(reruns=5)
5656
def test_cookieblocking_stops_saving(self):
5757
self.load_url(f"https://{self.COOKIE_DOMAIN}/")
5858
assert not self.driver.get_cookies(), (
@@ -72,7 +72,7 @@ def test_cookieblocking_stops_saving(self):
7272
"Cookie fixture should have been blocked from setting a cookie")
7373

7474
# TODO sporadic "We should have sent a cookie at this point" failures
75-
@pytest.mark.flaky(reruns=3)
75+
@pytest.mark.flaky(reruns=5)
7676
def test_cookieblocking_stops_sending(self):
7777
self.load_url(self.COOKIE_FIXTURE_URL)
7878
self.wait_for_and_switch_to_frame("iframe[src]", timeout=1)
@@ -109,7 +109,8 @@ def test_cookieblocking_base_overwrites_subdomain_block(self):
109109
self.load_url(self.FIXTURE_URL + '?alt3p')
110110
self.assert_load()
111111

112-
@pytest.mark.flaky(reruns=3, condition=pbtest.shim.browser_type == "edge")
112+
# @pytest.mark.flaky(reruns=3, condition=pbtest.shim.browser_type == "edge")
113+
@pytest.mark.flaky(reruns=5)
113114
def test_blocking_fp_script_served_from_cookieblocked_cdn(self):
114115
"""Since we have a surrogate script for FingerprintJS served from
115116
cdn.jsdelivr.net, we need to test surrogation rather than blocking."""
@@ -361,7 +362,8 @@ def test_reenabling_dnt_policy_checking(self):
361362

362363
self.load_url(self.FIXTURE_URL)
363364
self.assert_load()
364-
365+
366+
@pytest.mark.flaky(reruns=5)
365367
def test_removing_dnt(self):
366368
self.block_domain(self.THIRD_PARTY_DOMAIN)
367369
self.set_dnt(self.THIRD_PARTY_DOMAIN)

tests/selenium/dnt_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_dnt_policy_check_should_not_send_cookies(self):
148148
result = self.check_dnt(TEST_DOMAIN)
149149
assert result, "One or more cookies were sent (cookies=0 policy hash did not match)"
150150

151-
@pytest.mark.flaky(reruns=3, condition=pbtest.shim.browser_type in ("chrome", "edge"))
151+
@pytest.mark.flaky(reruns=5, condition=pbtest.shim.browser_type in ("chrome", "edge"))
152152
def test_should_not_record_nontracking_domains(self):
153153
NONTRACKING_FIXTURE_URL = (
154154
"https://efforg.github.io/privacybadger-test-fixtures/html/"

tests/selenium/popup_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_welcome_page_reminder_overlay(self):
4444
self.driver.find_element(By.ID, "intro-reminder-btn").click()
4545

4646
# switch to the welcome page or fail
47-
self.switch_to_window_with_url(self.first_run_url)
47+
self.switch_to_window_with_url(self.first_run_url, max_tries=4)
4848

4949
def test_help_button(self):
5050
"""Ensure FAQ website is opened when help button is clicked."""
@@ -76,7 +76,7 @@ def test_options_button(self):
7676
pass
7777
self.open_popup()
7878
self.driver.find_element(By.ID, "options").click()
79-
self.switch_to_window_with_url(self.options_url)
79+
self.switch_to_window_with_url(self.options_url, max_tries=4)
8080

8181
def test_trackers_link(self):
8282
"""Ensure trackers link opens EFF website."""

0 commit comments

Comments
 (0)