Repository navigation
Commit 6e6173a
test(buzz-db): fix two PostgreSQL-lane timing flakes (#8472)
## Summary
Two timing flakes in the PostgreSQL lane, one fix each.
### Deletion lock order
`abort_serializes_before_fence_without_deadlock` failed on main ([run
39330176879](https://github.com/block/buzz/actions/runs/39330176879)):
`post-lock lease verification rejects aborted request: 1`.
The test slept 50ms and assumed `abort` had queued on the community
advisory lock by then. On a slow runner, `fence` queued first, won the
lock, and succeeded.
The test now waits until `pg_locks` shows each contender waiting on that
community's lock, `abort` first and then `fence`. Postgres grants queued
advisory locks in arrival order, so `abort` always wins. The sleeps and
their timing guess are gone.
### Saturated-reader fixture
`routed_fallback_spends_one_acquire_budget_when_aurora_cache_is_cold`
failed this PR's first run ([run
39335038111](https://github.com/block/buzz/actions/runs/39335038111)):
`establish the reader's sole connection: PoolTimedOut`. Setup opens the
reader's only connection through the production lazy pool, which has a
150ms acquire timeout. On a loaded runner that first connect took
longer, so the test failed before reaching the budget it measures. Setup
now retries on `PoolTimedOut` within 5s. The pool and its 150ms budget
are unchanged for the routed read under test.
Test-only. Production code is unchanged.
## Validation
- Deletion test against an isolated local Postgres 17 database: 40/40
passes. Saturated-reader test: 15/15.
- `cargo fmt --check`, `cargo clippy -p buzz-db --tests -D warnings`,
pre-push Rust unit tests: pass.
- Three other `store::deletion::postgres_tests` fail locally on
unmodified `main` as well (local environment). CI's PostgreSQL lane is
the authoritative check for them.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Signed-off-by: Wes <[email protected]>
Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent edbfbf0 commit 6e6173a
2 files changed
Lines changed: 41 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1982 | 1982 | | |
1983 | 1983 | | |
1984 | 1984 | | |
1985 | | - | |
1986 | | - | |
1987 | | - | |
1988 | | - | |
1989 | | - | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
1990 | 1999 | | |
1991 | 2000 | | |
1992 | 2001 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4833 | 4833 | | |
4834 | 4834 | | |
4835 | 4835 | | |
| 4836 | + | |
| 4837 | + | |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
| 4852 | + | |
| 4853 | + | |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
4836 | 4859 | | |
4837 | 4860 | | |
4838 | 4861 | | |
| |||
6778 | 6801 | | |
6779 | 6802 | | |
6780 | 6803 | | |
6781 | | - | |
| 6804 | + | |
| 6805 | + | |
| 6806 | + | |
6782 | 6807 | | |
6783 | 6808 | | |
6784 | 6809 | | |
6785 | 6810 | | |
6786 | 6811 | | |
6787 | 6812 | | |
6788 | 6813 | | |
6789 | | - | |
| 6814 | + | |
6790 | 6815 | | |
6791 | 6816 | | |
6792 | 6817 | | |
| |||
0 commit comments