Flaky test: Phase3IntegrationTest.test17_getTasteProfile returns 409 #207

Closed
opened 2026-12-01 14:37:43 +01:00 by midas · 0 comments
Owner

Seen on CI run 667 (branch fix/podcast-detail-unsubscribed, unrelated change). GET of the taste profile returned 409 CONFLICT instead of 200: a unique-index violation on taste_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 DataIntegrityViolationException is mapped to 409 by GlobalExceptionHandler.

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).

Seen on CI run 667 (branch `fix/podcast-detail-unsubscribed`, unrelated change). `GET` of the taste profile returned 409 CONFLICT instead of 200: a unique-index violation on `taste_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 `DataIntegrityViolationException` is mapped to 409 by `GlobalExceptionHandler`. 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).
midas closed this issue 2026-12-01 22:38:09 +01:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midas/podradar#207
No description provided.