gstack/browse
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
..
bin feat: multi-agent support — gstack works on Codex, Gemini CLI, and Cursor (v0.9.0) (#226) 2026-03-19 18:20:50 -07:00
scripts fix: ngrok Windows build + close CI error-swallowing gap (v0.18.0.1) (#1024) 2026-04-16 13:49:04 -07:00
src v1.58.3.0 feat: gbrowser anti-detection Layer C stealth (#2047) 2026-06-18 10:45:05 -07:00
test fix(tests): stop browse/design teardowns from killing the whole bun run 2026-07-04 08:16:43 +03:00
PLAN-snapshot-dropdown-interactive.md fix: snapshot -i auto-detects dropdown/popover interactive elements (#845) 2026-04-05 22:57:45 -07:00
SKILL.md v1.58.5.0 feat: first-run activation scaffold + gstack router front door (#2078) 2026-06-25 09:42:45 -07:00
SKILL.md.tmpl v1.57.8.0 feat: browse js/eval --out render-to-file (canonical Chromium for offline rendering) (#1929) 2026-06-09 21:02:30 -07:00