Skip to content

Commit 3a73fcf

Browse files
committed
tests: isolate failpoint lock counts into per-test key bands
The txn_cleanup_* failpoint tests share one cluster and run serially, and they counted locks with a whole-keyspace scan. Async-commit locks resolve in the background and drain at an unpredictable rate, so a later test's unbounded scan would catch an earlier test's still-draining residue and over-count (flaky '575 vs 512'; #525). txn_cleanup_locks_batch_size is the worst offender: it stubs resolution via before-cleanup-locks and leaves 512 async-commit locks behind. Fix, test-only. Give each lock-counting case its own disjoint band of the u32 key space and scope both its lock scans and its cleanup_locks calls to that band, so a neighbour's residual locks are never fetched or counted. Single-key tests scan only their own key. The bands are a large fraction of the key space rather than a one-byte prefix, so under MULTI_REGION each still spans several regions and the cross-region cleanup/retry paths these tests exist to exercise stay covered. - Partition the key space into NUM_KEY_BANDS bands; write_data generates keys inside a given band; count_locks_in_band / wait_for_locks_count_in_band scope the scans; count_locks_of_key scopes the single-key tests. - Scope every cleanup_locks call to the acting test's band (the batch-size test's resolved_locks assertion depended on this). - Drop the whole-keyspace helpers. Suite is stable across repeated runs locally, including MULTI_REGION=1; no client (src/) change. Signed-off-by: Eduard R. <eduard@ralphovi.net>
1 parent 2aa94c1 commit 3a73fcf

1 file changed

Lines changed: 179 additions & 58 deletions

File tree

0 commit comments

Comments
 (0)