Skip to content

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

CI: Windows shards run two test files at once (#5320)

Milind Soni1d7120861b38
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 429a37ecbf..55fa1c20e5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -191,7 +191,7 @@ jobs:
runs-on: ${{ matrix.os }}
# scripts/testing/duration-sequencer.ts splits each platform's files by
# their recorded seconds on that platform, about 6 minutes a Linux shard
- # (four files at once) and 10 to 15 a Windows one (one at a time). The cap
+ # (four files at once); a Windows shard runs two files at once. The cap
# catches a hang, not normal suite growth; Windows runners are about 1.45x
# slower and vary more.
timeout-minutes: ${{ matrix.os == 'ubuntu-latest' && 25 || 30 }}
diff --git a/docs/ci.md b/docs/ci.md
index 2aad3622b7..9415e2c849 100644
--- a/docs/ci.md
+++ b/docs/ci.md
@@ -102,10 +102,12 @@ builds the matrix.
`OMB_VITEST_WORKERS` in `vite.config.ts`), one for each of the runner's vCPUs.
Most of a shard's time is waiting on real servers and fake engines: one file at
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
+A Windows shard runs two files at a time: one at a time it took 9 to 14
+minutes and was the last job of every run that had one. 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. Four files share the runner's CPU, so test and hook
+meet another file's. 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
@@ -158,6 +160,7 @@ For example, a full Windows shard 3/8 uses PowerShell syntax:
```powershell
$env:OMB_VITEST_E2E = "host"
$env:OMB_VITEST_SUBSET = ""
+$env:OMB_VITEST_WORKERS = "2"
pnpm exec vitest run --shard=3/8
```
diff --git a/scripts/ci-scope.mjs b/scripts/ci-scope.mjs
index 4ce5fe225c..c3dc4e6fab 100644
--- a/scripts/ci-scope.mjs
+++ b/scripts/ci-scope.mjs
@@ -331,8 +331,10 @@ export function laneOf(event) {
export const VITEST_SHARDS = { "macos-latest": 4, "ubuntu-latest": 8, "windows-latest": 8 };
// Test files at once on each platform's runner (OMB_VITEST_WORKERS, vite.config.ts). A Linux shard mostly waits on real
-// servers and fake engines: its 4 vCPU sat 70% idle one file at a time, and four files take a third of the time.
-export const VITEST_WORKERS = { "macos-latest": 1, "ubuntu-latest": 4, "windows-latest": 1 };
+// servers and fake engines: its 4 vCPU sat 70% idle one file at a time, and four files take a third of the time. A
+// Windows shard one file at a time took 9 to 14 minutes (Nov 10 2026) and set the length of every run that has one;
+// its runner has 4 vCPU too, so it runs two files at once.
+export const VITEST_WORKERS = { "macos-latest": 1, "ubuntu-latest": 4, "windows-latest": 2 };
/** ci.yml's vitest matrix: every shard of every selected platform, and which e2e files that platform runs. */
export function vitestMatrix(oses) {
diff --git a/scripts/ci-scope.test.ts b/scripts/ci-scope.test.ts
index cd147f913b..e2798891e7 100644
--- a/scripts/ci-scope.test.ts
+++ b/scripts/ci-scope.test.ts
@@ -78,7 +78,7 @@ describe("vitest matrix", () => {
const count = (os: string) => include.filter((entry) => entry.os === os).length;
expect([count("ubuntu-latest"), count("windows-latest"), count("macos-latest")]).toEqual([8, 8, 4]);
expect(include.find((entry) => entry.os === "windows-latest" && entry.shard === 8))
- .toEqual({ os: "windows-latest", part: "shard 8/8", shard: 8, shards: 8, files: "", e2e: "host", node_tests: false, workers: 1 });
+ .toEqual({ os: "windows-latest", part: "shard 8/8", shard: 8, shards: 8, files: "", e2e: "host", node_tests: false, workers: 2 });
expect(include.filter((entry) => entry.node_tests).map((entry) => [entry.os, entry.shard]))
.toEqual([["macos-latest", 1], ["ubuntu-latest", 1], ["windows-latest", 1]]);
expect(include.filter((entry) => entry.e2e === "all").every((entry) => entry.os === "ubuntu-latest")).toBe(true);