Flaky test: Phase3IntegrationTest.test17_getTasteProfile returns 409 #207
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seen on CI run 667 (branch
fix/podcast-detail-unsubscribed, unrelated change).GETof the taste profile returned 409 CONFLICT instead of 200: a unique-index violation ontaste_profiles(user_id).Two computations of the same user's taste profile race (the request and an event-triggered recompute, e.g. after a subscription or rating), both find no row and both insert. The loser's
DataIntegrityViolationExceptionis mapped to 409 byGlobalExceptionHandler.This can also happen in production, not only in the test. Wanted: make the taste-profile upsert tolerant of the concurrent insert (re-read on conflict, or serialise per user).