Skip to content

Commit 2a06fed

Browse files
committed
ci(visual): use domcontentloaded in pixel harness (self-hosted CfT load hang)
Self-hosted runner provisions a fresh Chrome-for-Testing build via @puppeteer/browsers; under it page.goto(waitUntil:load) never fires the load event within 15s because a non-essential subresource (favicon) stays pending, failing Web-static verify on #439 only. The four dashboard scripts are synchronous head scripts (executed by DOMContentLoaded) and #defrag-canvas is gated by the explicit waitForSelector, so switching to domcontentloaded is render-correct and cannot regress the GitHub-hosted apt-chrome run on master.
1 parent 85e58f2 commit 2a06fed

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

web-static/sharechain-explorer/tests/visual/capture.mjs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,17 @@ async function capture(mode, outfile) {
5656
// Suppress console errors from unused endpoints (Mock returns {} for
5757
// a handful of dashboards we don't care about.)
5858
page.on('pageerror', (err) => console.error(`[${mode}] pageerror`, err.message));
59-
// `load` rather than `networkidle0` — bundled mode opens a
60-
// persistent SSE connection that keeps "network" non-idle.
61-
await page.goto(url, { waitUntil: 'load', timeout: 15000 });
62-
await page.waitForSelector('#defrag-canvas', { timeout: 5000 });
59+
// `domcontentloaded` rather than `load`/`networkidle0`. The four
60+
// dashboard scripts (d3, multipool, highcharts*) are synchronous
61+
// <head> classic scripts, so they have downloaded + executed by
62+
// DOMContentLoaded and #defrag-canvas already exists — the explicit
63+
// waitForSelector below gates render deterministically. `load` is
64+
// fragile: a fresh Chrome-for-Testing build (self-hosted runner)
65+
// leaves a non-essential subresource (favicon/image) pending and
66+
// never fires the load event within the timeout; `networkidle0`
67+
// never settles because bundled mode opens a persistent SSE conn.
68+
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 15000 });
69+
await page.waitForSelector('#defrag-canvas', { timeout: 8000 });
6370
// Generous fixed delay lets both paths complete their initial
6471
// fetch + render. Deterministic against the mock server (no live
6572
// data, no SSE pushes).

0 commit comments

Comments
 (0)