Skip to content

fix(federator): record mock-federator requests atomically - #5437

Open
blackheaven wants to merge 2 commits into
developfrom
gdifolco/fix-flaky-tests-testBulkGetQualifiedConvs
Open

fix(federator): record mock-federator requests atomically#5437
blackheaven wants to merge 2 commits into
developfrom
gdifolco/fix-flaky-tests-testBulkGetQualifiedConvs

Conversation

@blackheaven

Copy link
Copy Markdown
Contributor

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@blackheaven
blackheaven requested a review from a team as a code owner August 11, 2026 09:22
@blackheaven

blackheaven commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

I wonder if the MockServer should also be moved to tests, WDYT?

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Aug 11, 2026
The mock federator recorded each served request with a non-atomic
modifyIORef append. When galley fans out federated calls concurrently
per remote domain, multiple Warp workers performed read-modify-write on
the shared IORef and lost updates. The dropped write made
testBulkGetQualifiedConvs (post conversations/list/v2) intermittently
fail: the response was served but the request unrecorded, so the
assertion over receivedRequests decoded to Nothing.

Replace the non-atomic modifyIORef with atomicModifyIORef', and add a
regression test that fires 50 concurrent requests at the mock and
asserts all are recorded (fails intermittently before the fix,
deterministic after).
@blackheaven
blackheaven force-pushed the gdifolco/fix-flaky-tests-testBulkGetQualifiedConvs branch from 8b0295c to cb29499 Compare August 11, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants