From b88904c360f46f18964911911293cd718bf46db6 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Mon, 19 Oct 2026 13:32:54 +0100 Subject: [PATCH] web: let concurrent ui-smoke runs pick their own port Every run defaulted to 8091, so two parallel pipeline items running the UI check collided with EADDRINUSE. An explicit --port/WEB_UI_PORT still wins; otherwise the OS assigns a free port. Verified with two simultaneous --scratch runs (60540/60541), both PASS. --- web/test/ui-smoke.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/test/ui-smoke.mjs b/web/test/ui-smoke.mjs index 474e4f06..8d2b49e1 100644 --- a/web/test/ui-smoke.mjs +++ b/web/test/ui-smoke.mjs @@ -2,7 +2,9 @@ // Chrome, connect to a running Pipelines server through the page's own proxy, // and capture what actually rendered. // -// node test/ui-smoke.mjs [--port 8091] [--pipelines 127.0.0.1:8080] [--out DIR] [--scratch] +// node test/ui-smoke.mjs [--port PORT] [--pipelines 127.0.0.1:8080] [--out DIR] [--scratch] +// +// Without --port the OS picks a free port, so concurrent checks do not collide. // // This is the UI evidence a review stage produces: real screenshots of the // rendered client, not a claim. It needs a running Pipelines server (the live one @@ -51,7 +53,12 @@ function flag(argv, name, fallback) { return i !== -1 && argv[i + 1] ? argv[i + 1] : fallback; } -const port = Number(flag(process.argv, "--port", process.env.WEB_UI_PORT ?? 8091)); +// No fixed default port: an explicit --port/WEB_UI_PORT still wins, but otherwise +// each run asks the OS for a free one. Concurrent checks (parallel pipeline items) +// therefore never collide on 8091 — the earlier fixed default made a second +// simultaneous UI stage fail with EADDRINUSE. +const explicitPort = flag(process.argv, "--port", process.env.WEB_UI_PORT); +const port = explicitPort ? Number(explicitPort) : await freePort(); const pipelines = flag(process.argv, "--pipelines", process.env.PIPELINES_TARGET ?? "127.0.0.1:8080"); const out = resolve( flag(process.argv, "--out", process.env.WEB_UI_OUT ?? join(tmpdir(), "pipelines-web-ui")),