Files
sowai-fiscal-svc/tests/certificates
jonatanritterandClaude Opus 4.8 39ba81efad test: force the concurrent-upload race deterministically with asyncio.Event
Plain asyncio.gather on one event loop could let the first upload commit
before the second's pre-check, making the second a legitimate replace (2
successes, 1 live row) -- correct behavior that fails the '1 conflict'
assertion. Same Event-synchronization pattern as the auto's HTTP race tests:
hold the first past its pre-check until the second also pre-checks, so both
read None before either writes and the partial-unique index decides
deterministically. Code under test untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 02:15:16 -03:00
..