Start the smoke test server on the port in SMOKE_URL

Two checkouts can then run their smoke tests at the same time.
This commit is contained in:
Knotty Wyvern
2026-10-27 22:42:39 -07:00
parent bd46f3a189
commit e217eb31d2
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -115,7 +115,9 @@ async function reachable(url) {
async function startServer() {
const vite = path.join(root, "node_modules", "vite", "bin", "vite.js");
const server = spawn(process.execPath, [vite, "dev"], { cwd: root, stdio: "ignore", windowsHide: true });
// Serve on the port in SMOKE_URL, so that two checkouts can run their tests at the same time.
const port = new URL(env.SMOKE_URL).port || "1420";
const server = spawn(process.execPath, [vite, "dev", "--port", port, "--strictPort"], { cwd: root, stdio: "ignore", windowsHide: true });
for (let waited = 0; waited < 60000; waited += 500) {
if (await reachable(env.SMOKE_URL)) return server;
await new Promise(resolve => setTimeout(resolve, 500));