Repository navigation
Conversation
Chrome startup fell back to chromiumoxide's 20s default, which a cold start on a loaded CI runner can exceed, failing collects_gpt_slot_from_local_fixture with a websocket URL timeout. Set an explicit 60s launch timeout in build_browser_config, shared by both audit collectors. Closes #1255 Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Review summary
Reviewed 5bcc80c8f8056cbbb27f01f92e9ee260a58edf65 against 7a0ecb4cbfa39af3d83f7e1ed2733d7eabdc4cb1. No actionable issues introduced by this PR were found.
Traced the shared browser configuration through both collectors and their page-audit, ad-template verification, generation, and legacy-alias consumers. The change raises debugging-WebSocket discovery timeout from 20 to 60 seconds without changing navigation, certificate validation, or teardown settings.
Safety proof
Runtime probes against the GPT browser fixture confirmed both sides of the startup boundary. Stopping the test-owned Chrome launcher with SIGSTOP and resuming after 22 seconds produced successful collection in 23.39 seconds. Leaving it stopped produced the expected launch-timeout error in 60.01 seconds. The launcher was reaped in both cases. The stalled probe intentionally caused the fixture's expected panic; the controller's timeout and cleanup assertions passed.
Validation
cargo fmt --all -- --check: passed.TS_AUDIT_BROWSER_TESTS=1 CHROME=/usr/bin/chromium cargo test --locked --package trusted-server-cli --target x86_64-unknown-linux-gnu commands::audit::browser::tests:: -- --include-ignored --test-threads=1: 8 passed.TS_AUDIT_BROWSER_TESTS=1 CHROME=/usr/bin/chromium cargo test --locked --package trusted-server-cli --target x86_64-unknown-linux-gnu --lib commands::audit::generate::browser_collector::tests:: -- --include-ignored --test-threads=1: 32 passed.cargo clippy --locked --package trusted-server-cli --target x86_64-unknown-linux-gnu --all-targets --all-features -- -D warnings: passed.- All reported CI checks passed. Inspected logs confirm the reviewed head/base merge and successful ignored browser fixtures in the Axum job.
- Existing reviews, inline comments, issue comments, and review threads were empty at review time.
Residual risk: the original loaded-runner flake was not reproduced. Timing probes ran on Linux, not macOS. The checkout remained clean; no files were edited and no review work was delegated.
Summary
collects_gpt_slot_from_local_fixturesometimes fails in thecargo test (axum native)CI job withfailed to launch browser: Timeout while resolving websocket URL from browser process. Chrome took longer than chromiumoxide's default 20s launch timeout to start on a loaded runner, which is a slow environment, not a broken test.build_browser_config. Both audit collectors (ts auditpage collection andts audit generate) share this function, so slow operator machines benefit too.Changes
crates/trusted-server-cli/src/commands/audit/browser.rsBROWSER_LAUNCH_TIMEOUT(60s) constant and pass it vialaunch_timeoutinbuild_browser_configCloses
Closes #1255
Test plan
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute serve./scripts/test-cli.shwith local Chromium (runs the ignored browser fixtures, includingcollects_gpt_slot_from_local_fixture),cargo clippy-cli,cargo test-cloudflare,cargo clippy-cloudflareChecklist
unwrap()in production code — useexpect("should ...")tracingmacros (notprintln!)launch_timeoutpub(crate), so the configured value cannot be asserted from this crate; the existing browser fixtures exercise the launch path