You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky: the workers page Events tab test closes the page before a response is read #1005
e2e/console/workers.spec.ts:785 "the workers page › on a gateway the Events tab lists only that worker's events, on a single host all of them, and scrolls back through that worker's history, shows its new events at the top, and with none says No events for this worker yet." fails in the Console (4/4) job, its retry too:
Error: response.json: Target page, context or browser has been closed
> 828 | void response.json().then((body: { events?: (typeof answered)[number][] }) => {
What you expected
The test passes on every run of an unchanged commit.
How to reproduce
Seen twice on two commits that leave the console alone: CI run 40184982178 on main at def25c8, and attempt 1 of run 40193478934 on PR #1003. A re-run of the failed jobs passed.
Environment
GitHub Actions, Console (4/4) shard, chromium.
Logs and evidence
gh run view 40184982178 --log-failed; gh run view 40193478934 --attempt 1 --log-failed.
Defect in the test, not the console: every assertion passes, then an unread body rejects as the page closes. Correction: the console lane has no retries (playwright.config.ts); "its retry too" was the second run.
e2e/console/workers-events-read-outlives-page.spec.ts on bug/1005-repro, "a /v1/events body still unread when host.dispose() closes the page is dropped by the Events tab test's reader instead of escaping it". It holds the older-page read until host.dispose() has closed the page. Fails 6 of 6:
pnpm test:console --project=chromium e2e/console/workers-events-read-outlives-page.spec.ts
Error: the reader must read or quietly drop a /v1/events body the page closed under, not let the rejection escape it
+ "Error: response.json: Target page, context or browser has been closed",
The lane test failed 2 of 104 runs here under load. The read still open at its end was always the host's before=…&limit=100.
Root cause
e2e/console/workers.spec.ts:828 reads every /v1/events body with void response.json(), which is never awaited and has no catch, and the listener stays on to the end of the test. The single host's Events tab, the last page, asks for its first older page as it opens. The last assertion (:895) does not wait for that read. host.dispose() (:897) closes the page first (e2e/console/fixtures.ts:325, closeActivePages). If the body is still unread at that moment, the read rejects and Playwright fails the test.
Simplest fix
Keep the read promises in an array, await Promise.all(reads) before the answered assertions, then page.off("response", …) so the host part starts no reads. Apply the same reader change to the reproduction, or delete it once the fix lands.
Alternatives rejected
.catch(() => undefined) on the read: the listener still reads pages the claim does not cover.
host.dispose({ preservePages: [page] }): the page fixture closes the page later anyway.
Risk
answered must still hold more than 100 events after the change. A read that never settles would hang the test instead of failing it.
Activity
V3RON commentedon Oct 25, 2026
Reproduction
Defect in the test, not the console: every assertion passes, then an unread body rejects as the page closes. Correction: the console lane has no retries (
playwright.config.ts); "its retry too" was the second run.e2e/console/workers-events-read-outlives-page.spec.tsonbug/1005-repro, "a /v1/events body still unread when host.dispose() closes the page is dropped by the Events tab test's reader instead of escaping it". It holds the older-page read untilhost.dispose()has closed the page. Fails 6 of 6:The lane test failed 2 of 104 runs here under load. The read still open at its end was always the host's
before=…&limit=100.Root cause
e2e/console/workers.spec.ts:828reads every/v1/eventsbody withvoid response.json(), which is never awaited and has no catch, and the listener stays on to the end of the test. The single host's Events tab, the last page, asks for its first older page as it opens. The last assertion (:895) does not wait for that read.host.dispose()(:897) closes the page first (e2e/console/fixtures.ts:325,closeActivePages). If the body is still unread at that moment, the read rejects and Playwright fails the test.Simplest fix
Keep the read promises in an array,
await Promise.all(reads)before theansweredassertions, thenpage.off("response", …)so the host part starts no reads. Apply the same reader change to the reproduction, or delete it once the fix lands.Alternatives rejected
.catch(() => undefined)on the read: the listener still reads pages the claim does not cover.host.dispose({ preservePages: [page] }): the page fixture closes the page later anyway.Risk
answeredmust still hold more than 100 events after the change. A read that never settles would hang the test instead of failing it.Written by an agent.
V3RON commentedon Oct 25, 2026
Delivery run
Merged: #1008 (#1005)
Written by an agent.