From fbd6ad0b23ff0ae58c3232b767a355a6d84c8100 Mon Sep 17 00:00:00 2001 From: scttbnsn <80784472+scttbnsn@users.noreply.github.com> Date: Fri, 9 Oct 2026 15:21:00 -0400 Subject: [PATCH] fix(web): relaunch Chrome when it never opens its debugging port --- scripts/lighthouse-budget.mjs | 3 +++ scripts/lighthouse-budget.test.mjs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/lighthouse-budget.mjs b/scripts/lighthouse-budget.mjs index 12ef0832..c190df17 100644 --- a/scripts/lighthouse-budget.mjs +++ b/scripts/lighthouse-budget.mjs @@ -150,6 +150,9 @@ export function isChromeConnectionError(error) { /unable to connect to chrome/i.test(message) || /failed to fetch browser websocket url/i.test(message) || /chrome (has crashed|failed to launch|connection)/i.test(message) || + // chrome-launcher's launch timeout: Chrome started and never wrote its + // DevTools port to chrome-err.log. + /waiting for dynamic debugging port/i.test(message) || /(target|session) closed/i.test(message) ) { return true; diff --git a/scripts/lighthouse-budget.test.mjs b/scripts/lighthouse-budget.test.mjs index 8e12634d..c98950de 100644 --- a/scripts/lighthouse-budget.test.mjs +++ b/scripts/lighthouse-budget.test.mjs @@ -120,6 +120,9 @@ test("isChromeConnectionError matches Chrome/connection failures and not budget ); assert.ok(isChromeConnectionError(new Error("read ECONNRESET"))); assert.ok(isChromeConnectionError(new Error("socket hang up"))); + assert.ok( + isChromeConnectionError(new Error("waiting for dynamic debugging port in chrome-err.log")), + ); assert.ok( !isChromeConnectionError(new Error("marketing performance budget exceeded: 0.5 < 0.66")), );