mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
The suite wipes the database between files with one TRUNCATE, which needs the strictest lock on every table at the same time. The server writes in thirty-nine places without awaiting the result, so one of those can land after the test that caused it has returned, and Postgres then picks the truncate as the deadlock victim. It failed an unrelated file twice in two days and passed on the rerun both times. The truncate is retried up to four times, on that one error and no other, with a short back-off. Three cases hold it there: a deadlock that clears, an error that is not a deadlock and must not be retried at all, and a deadlock that never clears and must still fail. All three go red without the retry.