Skip to content

Commit f27ed58

Browse files
committed
fix(test): skip isolate Worker hammers off Windows
Bun 1.3.14 also segfaults this file mid-suite on ubuntu GHA with balanced worker counts after the first green assertion. Keep the regression on win32.
1 parent f3bbc60 commit f27ed58

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

tests/storage-worker-teardown-isolate.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
* workers_terminated(N-1)` on Windows and kills the whole run.
88
*
99
* A second Bun 1.3.14 failure mode is a mid-file / post-suite segfault with a
10-
* *balanced* `workers_spawned === workers_terminated` count (exit 133 /
11-
* Trace/BPT on macOS Silicon). Churn caps and short settles were not enough
12-
* under GHA load. Keep isolate everywhere, skip Worker-spawning cases on
13-
* darwin (platform-cap meta-test still runs), and keep OS-join settle in
14-
* `worker-lifecycle` for win32/darwin.
10+
* *balanced* `workers_spawned === workers_terminated` count (exit 132/133).
11+
* Seen on macOS Silicon and ubuntu GHA even after the first green assertion in
12+
* this file. Churn caps and short settles were not enough. Keep isolate
13+
* everywhere; skip Worker-spawning hammers on non-Windows (platform-cap
14+
* meta-test still runs); win32 keeps the regression for the original panic.
15+
* OS-join settle stays in `worker-lifecycle` for win32/darwin.
1516
*
1617
* These cases hammer the exact failure window: fire-and-forget terminate must
1718
* still be joinable by drain, and repeated spawn → reset cycles must leave the
@@ -40,18 +41,17 @@ let testDir = "";
4041
let previousHome: string | undefined;
4142

4243
/**
43-
* Bun 1.3.14 macOS Silicon: Worker spawn in this file still segfaults the
44-
* isolate process after green assertions (balanced counts). Skip the hammer
45-
* cases on darwin; win32/linux keep full coverage.
44+
* Bun 1.3.14: Worker spawn in this file still segfaults the isolate process
45+
* after green assertions with balanced counts on darwin and linux GHA. Skip
46+
* hammers off Windows; win32 keeps full coverage for the original panic.
4647
*/
47-
const skipDarwinWorkerSpawn = process.platform === "darwin";
48+
const skipNonWindowsWorkerSpawn = process.platform !== "win32";
4849

4950
/** Spawn/reset iterations for the heavy churn case — platform-stressed carefully. */
5051
function workerChurnCyclesForIsolate(): number {
5152
if (process.platform === "win32") return 8;
52-
// Darwin cases are skipped; keep the cap documented for the meta-test.
53+
// Non-Windows hammers are skipped; keep caps documented for the meta-test.
5354
if (process.platform === "darwin") return 1;
54-
// Linux: short loop — eight cycles segfaulted with balanced counts on ubuntu CI.
5555
return 2;
5656
}
5757

@@ -92,7 +92,7 @@ async function waitForLiveWorker(timeoutMs = 10_000): Promise<void> {
9292
throw new Error("no storage worker was ever spawned; this test would prove nothing");
9393
}
9494

95-
test.skipIf(skipDarwinWorkerSpawn)("drain joins a fire-and-forget terminate before the isolate boundary", async () => {
95+
test.skipIf(skipNonWindowsWorkerSpawn)("drain joins a fire-and-forget terminate before the isolate boundary", async () => {
9696
// Reproduces the old race: sync reset void-terminates (and used to deregister
9797
// immediately), then drain returned on an empty set while the thread exited.
9898
setStorageCleanupPolicyJobTestHooks({ blockMs: 800 });
@@ -110,7 +110,7 @@ test.skipIf(skipDarwinWorkerSpawn)("drain joins a fire-and-forget terminate befo
110110
expect(liveStorageWorkerCount()).toBe(0);
111111
}, { timeout: 30_000 });
112112

113-
test.skipIf(skipDarwinWorkerSpawn)("repeated Windows-style spawn/reset cycles leave no live workers", async () => {
113+
test.skipIf(skipNonWindowsWorkerSpawn)("repeated Windows-style spawn/reset cycles leave no live workers", async () => {
114114
const cycles = workerChurnCyclesForIsolate();
115115
for (let i = 0; i < cycles; i++) {
116116
// Fresh CODEX_HOME each cycle so a prior worker's SQLite handle cannot
@@ -131,11 +131,11 @@ test.skipIf(skipDarwinWorkerSpawn)("repeated Windows-style spawn/reset cycles le
131131
}
132132
}, { timeout: 60_000 });
133133

134-
test.skipIf(skipDarwinWorkerSpawn)("async beforeEach-style join between cycles leaves no live workers", async () => {
134+
test.skipIf(skipNonWindowsWorkerSpawn)("async beforeEach-style join between cycles leaves no live workers", async () => {
135135
// Mirrors storage-mutation-race: each case must await join before the next
136136
// spawn. A sync beforeEach reset used to fire-and-forget terminate and leave
137137
// workers_spawned(N) workers_terminated(N-1) for the next isolate reclaim.
138-
const cycles = process.platform === "win32" ? 6 : 2;
138+
const cycles = 6;
139139
for (let i = 0; i < cycles; i++) {
140140
await resetStorageCleanupPolicyJobForTestsAsync();
141141
await drainStorageWorkers();
@@ -164,7 +164,7 @@ test("isolate worker churn stays platform-capped", () => {
164164
else expect(cycles).toBe(2);
165165
});
166166

167-
test.skipIf(skipDarwinWorkerSpawn)("terminateStorageWorker is joinable and idempotent across callers", async () => {
167+
test.skipIf(skipNonWindowsWorkerSpawn)("terminateStorageWorker is joinable and idempotent across callers", async () => {
168168
setStorageCleanupPolicyJobTestHooks({ blockMs: 500 });
169169
seedArchived(isolatedCodexHome!.path);
170170
const started = requestStorageCleanupPolicyRun({

0 commit comments

Comments
 (0)