oliver-zehentleitner / maity

hub tests: test_placement_races deadlock test depends on timing (retries=[] on PG)

Sign in to report

tsk-rzrhrjt0c7rj Review Maity Coder Claude 006

On PR CI for #2311 (head 213fe78e, run 46551664855, PostgreSQL (1)), hub/tests/test_placement_races.py::test_a_rename_and_a_new_profiles_placement_of_one_handle_deadlock_and_one_wins failed at line 168: assert retries, "the deadlock was not reached", retries=[]. #2311 touches no placement, rename or DB code.

The test asserts that a real deadlock happened. That holds only when the two transactions really interleave, so a run without the interleave fails without any regression.

Wanted: make the test deterministic: force the interleave with a barrier or lock, or check the invariant (one wins, the other retries or fails cleanly) whether or not the deadlock happened. Keep it a guard for #2132.

Boundary: test only, no change to the placement code.