tests: give the positive waits of eleven e2e files the deadline of 30 s
Waits for something that must happen (a frame, a download, a url, an element, an upstream connect) had deadlines of 0.5 to 20 s, which judge the runner. They are 30 s now, in the unit each caller reads. The deadlines that are the promise of the product or a negative window (scroll_into_view_if_needed, the retry budget of an action that must fail) are left as they are.
This commit is contained in:
1 parent
32bd517d76
commit
873104fd8d
11 files changed
+26
-26
No files matched your search
@@ -107,7 +107,7 @@ class ExitGateway(DohGateway):
|
||||
return
|
||||
self.connects.append((host, port))
|
||||
try:
|
||||
upstream = socket.create_connection((host, port), timeout=10)
|
||||
upstream = socket.create_connection((host, port), timeout=30)
|
||||
except OSError:
|
||||
self._send(c, self._reply(5))
|
||||
return
|
||||
|
||||
@@ -246,8 +246,8 @@ def test_expect_reads_the_state_it_names(page, site):
|
||||
page.set_content("<input type=checkbox id=c><p id=h hidden>x</p>")
|
||||
with pytest.raises(AssertionError):
|
||||
expect(page.locator("#c")).to_be_checked(timeout=500)
|
||||
expect(page.locator("#c")).not_to_be_checked(timeout=500)
|
||||
expect(page.locator("#c")).not_to_be_checked(timeout=30_000)
|
||||
with pytest.raises(AssertionError):
|
||||
expect(page.locator("#h")).to_be_visible(timeout=500)
|
||||
expect(page.locator("#h")).to_be_hidden(timeout=500)
|
||||
expect(page.locator("#missing")).to_be_hidden(timeout=500)
|
||||
expect(page.locator("#h")).to_be_hidden(timeout=30_000)
|
||||
expect(page.locator("#missing")).to_be_hidden(timeout=30_000)
|
||||
@@ -31,7 +31,7 @@ def page(firefox_binary):
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary,
|
||||
humanize=False, headless=True) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.set_default_timeout(5000)
|
||||
page.set_default_timeout(30_000)
|
||||
page.set_content(PAGE)
|
||||
page.wait_for_function(
|
||||
"document.getElementById('child').contentDocument"
|
||||
|
||||
@@ -89,12 +89,12 @@ def test_reads_after_the_isolated_page_answer(page, site):
|
||||
"the engine did not isolate the page: this round tests nothing")
|
||||
# The read on the isolated page is what builds the script that went
|
||||
# stale; without it the bug never showed.
|
||||
assert page.locator("#p").inner_text(timeout=10_000) == "isolated"
|
||||
assert page.locator("#p").inner_text(timeout=30_000) == "isolated"
|
||||
# The page sends itself on, as a challenge page does: the move is its own location.replace, not a goto of ours.
|
||||
page.evaluate("moveOn()")
|
||||
page.wait_for_url("**/plain?i=%d" % i, timeout=10_000)
|
||||
page.wait_for_url("**/plain?i=%d" % i, timeout=30_000)
|
||||
assert page.evaluate("self.crossOriginIsolated") is False
|
||||
assert page.locator("#p").inner_text(timeout=10_000) == "plain"
|
||||
assert page.inner_text("#p", timeout=10_000) == "plain"
|
||||
assert page.locator("#p").inner_text(timeout=30_000) == "plain"
|
||||
assert page.inner_text("#p", timeout=30_000) == "plain"
|
||||
assert page.query_selector("#p") is not None
|
||||
assert page.locator("#p").all_inner_texts() == ["plain"]
|
||||
@@ -229,7 +229,7 @@ def test_the_iframe_runs_in_another_process(firefox_binary, cross_origin_harness
|
||||
# was there 30 of 30 on both, with no wait: that is what is asserted here, so a `goto` that returns
|
||||
# with a cross-site frame still without its url fails this test.
|
||||
page.goto(cross_origin_harness["parent_url"], wait_until="load", timeout=30_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=10_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=30_000)
|
||||
frame = page.query_selector("iframe#ifr_plain").content_frame()
|
||||
assert frame is not None and cross_origin_harness["child_origin"] in frame.url, (
|
||||
f"after the load of the page the iframe of the other site has url {getattr(frame, 'url', None)!r}")
|
||||
@@ -250,7 +250,7 @@ def test_cross_origin_iframe_url_appears_in_page_frames(firefox_binary, cross_or
|
||||
ctx = browser.new_context()
|
||||
page = ctx.new_page()
|
||||
page.goto(cross_origin_harness["parent_url"], wait_until="domcontentloaded", timeout=30_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=10_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=30_000)
|
||||
|
||||
# ⛔ WAIT FOR THE CONDITION, NOT FOR A DURATION. This was
|
||||
# `wait_for_timeout(500)`, and that measured the machine rather than
|
||||
@@ -311,7 +311,7 @@ def test_cross_origin_iframe_content_frame_resolves(firefox_binary, cross_origin
|
||||
ctx = browser.new_context()
|
||||
page = ctx.new_page()
|
||||
page.goto(cross_origin_harness["parent_url"], wait_until="domcontentloaded", timeout=30_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=10_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=30_000)
|
||||
|
||||
for sel in ("iframe#ifr_plain", "iframe#ifr_sandbox", "iframe#ifr_titled"):
|
||||
handle = page.query_selector(sel)
|
||||
@@ -337,7 +337,7 @@ def test_cross_origin_iframe_evaluate_returns_real_values(firefox_binary, cross_
|
||||
ctx = browser.new_context()
|
||||
page = ctx.new_page()
|
||||
page.goto(cross_origin_harness["parent_url"], wait_until="domcontentloaded", timeout=30_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=10_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=30_000)
|
||||
|
||||
cf = _child_frame_of(page, page.query_selector("iframe#ifr_plain"), cross_origin_harness["child_origin"])
|
||||
assert cf is not None
|
||||
@@ -358,12 +358,12 @@ def test_cross_origin_iframe_frame_locator_resolves_button(firefox_binary, cross
|
||||
ctx = browser.new_context()
|
||||
page = ctx.new_page()
|
||||
page.goto(cross_origin_harness["parent_url"], wait_until="domcontentloaded", timeout=30_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=10_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=30_000)
|
||||
|
||||
# count() does not wait (Playwright's own semantics): the iframe ELEMENT is in the parent, but its cross-origin document,
|
||||
# in a process of its own, can load later on a loaded runner (Windows CI of 13/11, run 43383366904: 0 elements). Wait for
|
||||
# the button first, as a script that counts it would.
|
||||
page.frame_locator("iframe#ifr_plain").locator("button#ok").wait_for(timeout=10_000)
|
||||
page.frame_locator("iframe#ifr_plain").locator("button#ok").wait_for(timeout=30_000)
|
||||
for selector in ("button#ok", "button.btn-primary"):
|
||||
cnt = page.frame_locator("iframe#ifr_plain").locator(selector).count()
|
||||
assert cnt == 1, f"locator({selector!r}) found {cnt} elements (expected 1)"
|
||||
@@ -384,7 +384,7 @@ def test_cross_origin_iframe_dispatch_event_click_works(firefox_binary, cross_or
|
||||
ctx = browser.new_context()
|
||||
page = ctx.new_page()
|
||||
page.goto(cross_origin_harness["parent_url"], wait_until="domcontentloaded", timeout=30_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=10_000)
|
||||
page.wait_for_selector("iframe#ifr_plain", timeout=30_000)
|
||||
|
||||
# the button of a document in another process can come later on a loaded runner: wait for it as a script would
|
||||
# (Windows CI of 13/11, run 43383366904: "found 0 elements"), then act, both with a deadline of 30 s
|
||||
@@ -490,7 +490,7 @@ def test_the_geometry_invariant_holds_inside_a_nested_frame(firefox_binary):
|
||||
# 2. and the relationship holds on the events received IN THERE
|
||||
frame = page.frame_locator("#f")
|
||||
page.frames[1].evaluate("() => { window.__ev = []; }")
|
||||
frame.locator("#g").hover(timeout=10000)
|
||||
frame.locator("#g").hover(timeout=30000)
|
||||
# until the frame has heard the pointer (its events come from another process, after the hover returned)
|
||||
wait_until(lambda: page.frames[1].evaluate("() => window.__ev.length") > 0, 30,
|
||||
lambda: page.wait_for_timeout(100))
|
||||
|
||||
@@ -63,7 +63,7 @@ def test_a_clicked_download_is_reported_and_saved(firefox_binary, served, tmp_pa
|
||||
with InvisiblePlaywright(seed=4242, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_context(accept_downloads=True).new_page()
|
||||
page.goto(served, timeout=30_000)
|
||||
with page.expect_download(timeout=20_000) as info:
|
||||
with page.expect_download(timeout=30_000) as info:
|
||||
page.click("#dl")
|
||||
download = info.value
|
||||
assert download.suggested_filename == "report.bin"
|
||||
@@ -79,7 +79,7 @@ def test_a_navigation_that_ends_in_a_download_is_reported(firefox_binary, served
|
||||
|
||||
with InvisiblePlaywright(seed=4242, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_context(accept_downloads=True).new_page()
|
||||
with page.expect_download(timeout=20_000) as info:
|
||||
with page.expect_download(timeout=30_000) as info:
|
||||
with pytest.raises(Exception) as nav:
|
||||
page.goto(served + "file", timeout=20_000)
|
||||
# Playwright reports such a goto as "Download is starting"; it must END,
|
||||
|
||||
@@ -222,7 +222,7 @@ def test_the_lifecycle_WAITS_for_an_element_that_appears_later(firefox_binary):
|
||||
instead of a wait. The element appears after 1.2 seconds."""
|
||||
actions, inj, f, close = _open(firefox_binary, PAGE)
|
||||
try:
|
||||
actions.click("#slow", timeout=15)
|
||||
actions.click("#slow", timeout=30)
|
||||
finally:
|
||||
close()
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ def oop_page(firefox_binary, oop_origins):
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary, humanize=False,
|
||||
headless=True, extra_prefs=STRATEGY_1) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.set_default_timeout(5000)
|
||||
page.set_default_navigation_timeout(20000)
|
||||
page.set_default_timeout(30_000)
|
||||
page.set_default_navigation_timeout(30_000)
|
||||
page.goto(oop_origins["top"])
|
||||
page.wait_for_function("document.querySelector('#payment').contentWindow !== null")
|
||||
yield page
|
||||
|
||||
@@ -91,7 +91,7 @@ class _Socks5AuthRecorder:
|
||||
if cmd != 0x01: # only CONNECT
|
||||
conn.sendall(b"\x05\x07\x00\x01\x00\x00\x00\x00\x00\x00"); conn.close(); return
|
||||
try:
|
||||
up = socket.create_connection((addr, port), timeout=15)
|
||||
up = socket.create_connection((addr, port), timeout=30)
|
||||
except OSError:
|
||||
conn.sendall(b"\x05\x05\x00\x01\x00\x00\x00\x00\x00\x00"); conn.close(); return
|
||||
conn.sendall(b"\x05\x00\x00\x01\x00\x00\x00\x00\x00\x00")
|
||||
|
||||
@@ -184,8 +184,8 @@ def test_pushState_updates_page_url_and_wakes_wait_for_url(firefox_binary):
|
||||
seen = []
|
||||
page.on("framenavigated", lambda frame: seen.append(frame.url))
|
||||
|
||||
page.click("#route", timeout=15_000)
|
||||
page.wait_for_url("**/reports", timeout=15_000)
|
||||
page.click("#route", timeout=30_000)
|
||||
page.wait_for_url("**/reports", timeout=30_000)
|
||||
|
||||
assert page.url == url + "reports", page.url
|
||||
assert page.evaluate("location.href") == page.url
|
||||
|
||||
@@ -383,7 +383,7 @@ def test_force_turns_a_refusal_into_an_attempt(firefox_binary):
|
||||
assert page.evaluate("window.__o || 0") == 0, (
|
||||
"the refused click still reached the page")
|
||||
|
||||
page.click("#b", force=True, timeout=5000)
|
||||
page.click("#b", force=True, timeout=30_000)
|
||||
assert page.evaluate("window.__o || 0") == 1, (
|
||||
"force did not dispatch the event, so the option still means "
|
||||
"nothing to a caller")
|
||||
Reference in new issue
Block a user