test: the browser tests run with no internet
Every Booth page asks fonts.googleapis.com for its faces, and wait_until="networkidle" waits for that request. A stalled request to Google therefore held a page until goto's 30s timeout. That is the failure the full-suite flake shows: Page.goto timeouts in tests far apart within one run. A stalled font request reproduces it exactly. Whether that was THE cause is not proven: - 23 traced runs went green, against 1 red in 8 untraced; - no trace captured the pending request. A test that depends on Google being reachable is wrong regardless. Both browser fixtures now launch Chromium with every hostname but 127.0.0.1 failing DNS at once. Pages fall back to the system font stacks the tokens declare. Positive control in each file: an external host fails with ERR_NAME_NOT_RESOLVED in under 3s, and a Booth page still goes idle. Mutation-proved (r2b.toml 28/28). 776 passed.
This commit is contained in:
@@ -262,3 +262,23 @@ old = '''
|
||||
.blurred-thumb{filter:blur(16px)}'''
|
||||
new = '''
|
||||
.blurred-thumb{filter:blur(0px)}'''
|
||||
|
||||
# ---- the flake: the test browser has no internet (positive control per file)
|
||||
|
||||
[[mutation]]
|
||||
label = "the flow test browser can reach the internet (Google Fonts can stall networkidle)"
|
||||
file = "tests/test_flow_browser.py"
|
||||
test = "tests/test_flow_browser.py::test_the_test_browser_has_no_internet"
|
||||
old = '''
|
||||
b = pw.chromium.launch(args=OFFLINE)'''
|
||||
new = '''
|
||||
b = pw.chromium.launch()'''
|
||||
|
||||
[[mutation]]
|
||||
label = "the embed test browser can reach the internet"
|
||||
file = "tests/test_embed_browser.py"
|
||||
test = "tests/test_embed_browser.py::test_the_test_browser_has_no_internet"
|
||||
old = '''
|
||||
b = pw.chromium.launch(args=OFFLINE)'''
|
||||
new = '''
|
||||
b = pw.chromium.launch()'''
|
||||
|
||||
Reference in New Issue
Block a user