gstack/design/test
Stefan Andrei e7c37d76b9 fix(tests): stop browse/design teardowns from killing the whole bun run
Several browse and design test files armed `setTimeout(() => process.exit(0),
500)` inside afterAll as a workaround for a browser close() that can hang. That
assumes each test file runs in its own process. It doesn't: `bun test` runs
EVERY file in one shared process. The 500ms timer therefore fired partway
through a LATER test file and terminated the entire run with exit code 0 and no
summary. Because the exit code was 0, the suite could not gate — only a fraction
of the files ran, and every downstream failure was silently masked.

The fix removes the delayed process.exit from teardown and instead time-boxes
the resource cleanup: browser teardowns race `close()` against a short timeout
and abandon it if it hangs (the child is reaped at real process exit), and the
design daemon /shutdown test stubs `process.exit` around the shutdown timers so
they fire harmlessly. A new static-guard test, test/no-suicide-exit.test.ts,
scans every *.test.ts and fails if any file schedules a delayed process.exit,
so the pattern cannot silently return. test/user-slug-fallback.test.ts is made
deterministic via HOME isolation.

Verified: test/no-suicide-exit.test.ts + test/user-slug-fallback.test.ts pass
(15/15); browse/test/commands.test.ts passes standalone (243/243) and now runs
to a full summary; design/test/daemon.test.ts passes (34/34) with no early exit.

Honest note: with the suite now able to run to completion, it surfaces
pre-existing failures that the early exit had been hiding — e.g.
design/test/feedback-roundtrip.test.ts fails identically on unmodified
origin/main (a `session.clearLoadedHtml` stub gap), independent of this change.
These are not introduced here; this change only makes them visible so they can
be gated on and fixed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 08:16:43 +03:00
..
auth.test.ts v1.42.0.0 Daegu wave: 23 community-filed bugs + PTY classifier enforcement (24 bisect commits) (#1594) 2026-05-20 07:35:01 -07:00
daemon-discovery.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
daemon-tests-fixtures.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
daemon.test.ts fix(tests): stop browse/design teardowns from killing the whole bun run 2026-07-04 08:16:43 +03:00
feedback-roundtrip-daemon.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
feedback-roundtrip.test.ts fix(tests): stop browse/design teardowns from killing the whole bun run 2026-07-04 08:16:43 +03:00
gallery.test.ts feat: design binary — real UI mockup generation for gstack skills (v0.13.0.0) (#551) 2026-03-27 20:32:59 -06:00
serve.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
variants-retry-after.test.ts v1.30.0.0 fix wave: 21 community PRs + Windows CI extension + codex flag-semantics smoke (#1391) 2026-05-09 08:06:47 -07:00