test: ignore the disconnect when a test database is dropped #158

Sammanfogat
supernaut sammanfogade 1 incheckning från test/ignore-drop-disconnect in i main 2026-10-12 14:38:21 +00:00
Ägare

What

The Postgres test runs can fail after every test has passed, with one unhandled 57P01 (admin_shutdown) error.

freshDb().drop() calls pool.end(), which returns before the client sockets close. DROP DATABASE ... WITH (FORCE) then terminates a backend that is still closing. The client gets the FATAL message with no active query and emits error, which nothing handles.

The test pool now gives each client an error listener. Query errors still reject as before.

Tests

pnpm lint, pnpm typecheck and pnpm test with Postgres pass (442 tests).

## What The Postgres test runs can fail after every test has passed, with one unhandled `57P01` (admin_shutdown) error. `freshDb().drop()` calls `pool.end()`, which returns before the client sockets close. `DROP DATABASE ... WITH (FORCE)` then terminates a backend that is still closing. The client gets the FATAL message with no active query and emits `error`, which nothing handles. The test pool now gives each client an `error` listener. Query errors still reject as before. ## Tests `pnpm lint`, `pnpm typecheck` and `pnpm test` with Postgres pass (442 tests).
supernaut lade till 1 incheckning 2026-10-12 14:34:06 +00:00
test: ignore the disconnect when a test database is dropped
Alla kontroller lyckades
ci / ci (pull_request) Successful in 2m13s
623b9db597
pool.end() returns before the client sockets close. DROP DATABASE WITH
(FORCE) can then terminate a backend that is still closing, and the
client emits an unhandled 57P01 error that fails the run after every
test has passed.
supernaut sammanfogade incheckning c85a7d594d till main 2026-10-12 14:38:21 +00:00
supernaut tog bort grenen test/ignore-drop-disconnect 2026-10-12 14:38:21 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-payment!158
Ingen beskrivning angiven.