mirror of https://github.com/garrytan/gstack.git
test: gate compare-board's file-level hooks too — the intermittent staller
Skipped describes do NOT skip file-level hooks: the quarantined compare-board file still ran its top-level beforeAll (PNG fixtures + Bun.serve + a BrowserManager launch — exactly the 'needs a display-shaped env' code) on every run, and under parallel load that setup wedges. Caught red-handed by the runner's in-flight-at-kill epilogue: '⏱ in flight at kill: browse/test/compare-board.test.ts'. This was the suite's intermittent staller. Hooks now honor the same GSTACK_COMPARE_BOARD_TESTS gate; the gated file drops from 3.7s of live setup to 0.4s of pure skips. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
e99e53cc71
commit
d3e52d4c92
|
|
@ -49,6 +49,11 @@ function createTestPng(filePath: string): void {
|
|||
}
|
||||
|
||||
beforeAll(async () => {
|
||||
// Skipped describes do NOT skip file-level hooks: this setup (Bun.serve +
|
||||
// BrowserManager launch) still ran with all 16 tests skipped, and under
|
||||
// parallel load it wedges — caught by the runner's in-flight-at-kill
|
||||
// epilogue as the suite's intermittent staller. Gate the hooks too.
|
||||
if (!COMPARE_BOARD_ENABLED) return;
|
||||
// Create test PNG files
|
||||
tmpDir = '/tmp/compare-board-test-' + Date.now();
|
||||
fs.mkdirSync(tmpDir, { recursive: true });
|
||||
|
|
@ -80,6 +85,7 @@ beforeAll(async () => {
|
|||
});
|
||||
|
||||
afterAll(async () => {
|
||||
if (!COMPARE_BOARD_ENABLED) return;
|
||||
try { server.stop(); } catch {}
|
||||
fs.rmSync(tmpDir, { recursive: true, force: true });
|
||||
// Close only this file's own browser — never process.exit(): bun test runs
|
||||
|
|
|
|||
Loading…
Reference in New Issue