From d3e52d4c9239b073bd044f7371542b355fceb482 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 15 Aug 2026 15:30:11 -0700 Subject: [PATCH] =?UTF-8?q?test:=20gate=20compare-board's=20file-level=20h?= =?UTF-8?q?ooks=20too=20=E2=80=94=20the=20intermittent=20staller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- browse/test/compare-board.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/browse/test/compare-board.test.ts b/browse/test/compare-board.test.ts index 1fb66933f..10130d94b 100644 --- a/browse/test/compare-board.test.ts +++ b/browse/test/compare-board.test.ts @@ -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