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.
This commit is contained in:
@@ -2,7 +2,9 @@
|
|||||||
// Chrome, connect to a running Pipelines server through the page's own proxy,
|
// Chrome, connect to a running Pipelines server through the page's own proxy,
|
||||||
// and capture what actually rendered.
|
// 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
|
// 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
|
// 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;
|
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 pipelines = flag(process.argv, "--pipelines", process.env.PIPELINES_TARGET ?? "127.0.0.1:8080");
|
||||||
const out = resolve(
|
const out = resolve(
|
||||||
flag(process.argv, "--out", process.env.WEB_UI_OUT ?? join(tmpdir(), "pipelines-web-ui")),
|
flag(process.argv, "--out", process.env.WEB_UI_OUT ?? join(tmpdir(), "pipelines-web-ui")),
|
||||||
|
|||||||
Reference in New Issue
Block a user