ci(web-static): gate puppeteer navigate on a bounded server health-poll - #842
Merged
Conversation
The visual harness raced the mock-server start: the readiness loop was capped at 30x0.2s=6s and, worse, never checked its own result — it fell through to capture.mjs even when the server had not bound. On a busy self-hosted runner (VM905) the server binds late and puppeteer navigates into a dead port, producing net::ERR_CONNECTION_REFUSED that surfaces as a page/pixel assertion failure and false-reds coin-side PRs that never touch web/ (job 89644021788, run 30144644836, PR #839). Make the wait a real gate: health-poll 127.0.0.1:PORT (bounded 60s, override via READY_TIMEOUT), bail early if the server process dies, and on timeout fail with a distinguishable INFRA message + server log tail instead of letting puppeteer report an infra flake as a page regression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Web-static verify visual harness races the mock-server start.
tests/visual/run.shcapped its readiness loop at 30x0.2s = 6s and — the real bug — never checked the loop result, falling through tocapture.mjseven when the server had not bound. On a busy self-hosted runner (VM905) the server binds late, puppeteer navigates a dead port, andnet::ERR_CONNECTION_REFUSEDsurfaces as a page/pixel assertion failure — false-redding coin-side PRs that never touch web/.Repro: job 89644021788, run 30144644836, PR #839 (btc-only change). Same check green on #837/#840/#841 off the same base → job-level flake, not a regression.
Fix (milestone points 1-4)
127.0.0.1:$PORTbefore navigating — bounded 60s (READY_TIMEOUToverride), replacing the 6s race.::error::INFRA (not a page regression)message + tail ofmock-server.log, so an infra flake is never reported as a page assertion. Also bails early if the server pid dies (e.g. port in use).test -x \$CHROME_BIN || exit 1after 3 attempts. The blip-then-continue seen in the failing log was the retry succeeding on a transient chrome fetch; the actual failure was the downstream port race fixed here. No swallowed error — no change needed.Acceptance
Web-static verify runs regardless of path, so this PR triggers it; a green run will show
[2b] waiting up to 60s...→mock server ready after Ns, demonstrating the wait loop firing. A btc-only src/impl/btc/** PR can no longer fail this check on port/chrome availability.