Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

CI: timeouts double where files share a Linux shard's CPU

milind-soni3792a94e8675
diff --git a/docs/ci.md b/docs/ci.md
index ffc5718969..850806dd77 100644
--- a/docs/ci.md
+++ b/docs/ci.md
@@ -104,7 +104,8 @@ a time it took 16 minutes with the machine 70% idle, and four at a time 5.
Windows and macOS shards, and every local run, still run one file at a time. So
that files side by side never share a port, each worker picks from its own
(`server/testing/worker-port.ts`); a test that picks a port some other way can
-meet another file's.
+meet another file's. Four files share the runner's CPU, so test and hook
+timeouts double there, as on Windows (`server/testing/host-timeout.ts`).
**Which files run where.** Linux runs every file. Most e2e files drive
OMB's own logic through a real server and fake engines, which is the same on
diff --git a/server/testing/host-timeout.ts b/server/testing/host-timeout.ts
index a1040a0832..d76151c3b3 100644
--- a/server/testing/host-timeout.ts
+++ b/server/testing/host-timeout.ts
@@ -1,6 +1,9 @@
-// Windows CI runs this suite 1.4-1.5x slower than Linux, so every test and hook timeout doubles there
-// (vite.config.ts scales the defaults; explicit timeouts use hostTimeout()). Linux and macOS stay strict.
-export const HOST_TIMEOUT_FACTOR = process.platform === "win32" ? 2 : 1;
+// Windows CI runs this suite 1.4-1.5x slower than Linux, and a Linux shard that runs several files at once
+// (OMB_VITEST_WORKERS, scripts/ci-scope.mjs) shares its CPU between them, so every test and hook timeout doubles there
+// (vite.config.ts scales the defaults; explicit timeouts use hostTimeout()). One file at a time on Linux and macOS
+// stays strict.
+const sideBySide = Number(process.env.OMB_VITEST_WORKERS) > 1;
+export const HOST_TIMEOUT_FACTOR = process.platform === "win32" || sideBySide ? 2 : 1;
export function hostTimeout(ms: number): number {
return ms * HOST_TIMEOUT_FACTOR;