66
77import pbtest
88
9+ import time
910
1011class ContentFilteringTest (pbtest .PBSeleniumTest ):
1112 """Content filtering tests."""
@@ -52,14 +53,17 @@ def test_blocking(self):
5253 self .assert_block ()
5354
5455 # TODO sporadic "Cookie fixture should have set a cookie" failures
55- @pytest .mark .flaky (reruns = 5 )
56+ @pytest .mark .flaky (reruns = 7 )
5657 def test_cookieblocking_stops_saving (self ):
5758 self .load_url (f"https://{ self .COOKIE_DOMAIN } /" )
59+ time .sleep (1 )
5860 assert not self .driver .get_cookies (), (
5961 "Visiting the domain directly does not set a cookie" )
6062
6163 self .load_url (self .COOKIE_FIXTURE_URL )
64+ time .sleep (1 )
6265 self .load_url (f"https://{ self .COOKIE_DOMAIN } /" )
66+ time .sleep (1 )
6367 assert len (self .driver .get_cookies ()) == 1 , (
6468 "Cookie fixture should have set a cookie" )
6569
@@ -72,15 +76,17 @@ def test_cookieblocking_stops_saving(self):
7276 "Cookie fixture should have been blocked from setting a cookie" )
7377
7478 # TODO sporadic "We should have sent a cookie at this point" failures
75- @pytest .mark .flaky (reruns = 5 )
79+ @pytest .mark .flaky (reruns = 7 )
7680 def test_cookieblocking_stops_sending (self ):
7781 self .load_url (self .COOKIE_FIXTURE_URL )
82+ time .sleep (1 )
7883 self .wait_for_and_switch_to_frame ("iframe[src]" , timeout = 1 )
7984 self .wait_for_any_text ('body' )
8085 assert self .find_el_by_css ('body' ).text == "cookies=0" , (
8186 "No cookies should've been sent to start with" )
8287
8388 self .load_url (self .COOKIE_FIXTURE_URL )
89+ time .sleep (1 )
8490 self .wait_for_and_switch_to_frame ("iframe[src]" , timeout = 1 )
8591 self .wait_for_any_text ('body' )
8692 assert self .find_el_by_css ('body' ).text == "cookies=1" , (
@@ -89,6 +95,7 @@ def test_cookieblocking_stops_sending(self):
8995 self .cookieblock_domain (self .COOKIE_DOMAIN )
9096
9197 self .load_url (self .COOKIE_FIXTURE_URL )
98+ time .sleep (1 )
9299 self .wait_for_and_switch_to_frame ("iframe[src]" , timeout = 1 )
93100 self .wait_for_any_text ('body' )
94101 assert self .find_el_by_css ('body' ).text == "cookies=0" , (
@@ -110,7 +117,7 @@ def test_cookieblocking_base_overwrites_subdomain_block(self):
110117 self .assert_load ()
111118
112119 # @pytest.mark.flaky(reruns=3, condition=pbtest.shim.browser_type == "edge")
113- @pytest .mark .flaky (reruns = 5 )
120+ @pytest .mark .flaky (reruns = 7 )
114121 def test_blocking_fp_script_served_from_cookieblocked_cdn (self ):
115122 """Since we have a surrogate script for FingerprintJS served from
116123 cdn.jsdelivr.net, we need to test surrogation rather than blocking."""
0 commit comments