postjevsql.git / tests / support / CLAUDE.md
1@README.md
2
3- **The suite's invariants are one folder up**, in `tests/CLAUDE.md`.
4- **Start instances only through `TestPostgres`.** Its PDEATHSIG is what
5  makes teardown leak-proof; never spawn `postgres` another way.
6- **Never give an instance a TCP port.** It listens on a Unix socket in its
7  own temp dir: a port picked by binding 0 and releasing it can be taken by
8  another process before the server binds it.
9- **Several instances at once go through `TestPostgres::start_all`.**
10  Taking slots one at a time is hold-and-wait: three `sidecar_cli` tests on
11  3 cores each held one slot and waited for another until buck killed them
12  at 10 minutes (2026-09-27). A second `start` on a thread that already
13  holds a slot panics on purpose.
14- **The slot directory is fixed (`/tmp/postjevsql-test-slots-<uid>`),
15  not `temp_dir()`,** so every worktree's daemon and every test sandbox
16  share one set of slots.
17- **`gates.rs` is the one copy of what the gates ask.** A replay matches by
18  exact request bytes, so changing its rows, question or SQL breaks every
19  `gate_*` test until the fixtures are re-recorded.