Skip to content

Flaky concurrency tests on main: S3 conditional-write races no longer resolve deterministically #247

Description

@orekav

What's happening

Multiple pre-existing integration tests that assert strict "exactly one concurrent request wins, the rest get a specific conflict status" outcomes against S3 conditional writes are flaking intermittently in CI. Two different tests have failed so far, on two separate CI runs, each with a different symptom:

  1. test_remove_sync_factor_etag_concurrency (tests/delete_factor_integration.rs)
    Failed on the CI run for PR feat: prove backup account key on backup creation #243's merge into main:
    https://github.com/worldcoin/backup-service/actions/runs/32370987568/job/96431263059

    thread 'test_remove_sync_factor_etag_concurrency' panicked at tests/delete_factor_integration.rs:539:5:
    assertion `left == right` failed: Expected exactly one operation to succeed
    
  2. test_concurrent_sync_backup_prevention (tests/sync_backup_integration.rs)
    Failed on a rerun of PR test: cover Production enforcement of the backup account proof #245's CI:
    https://github.com/worldcoin/backup-service/actions/runs/32372620542/job/96439189750

    thread 'test_concurrent_sync_backup_prevention' panicked at tests/sync_backup_integration.rs:350:21:
    Unexpected status 412 Precondition Failed: {"allowRetry":false,"error":{"code":"manifest_hash_mismatch","message":"The manifest hash does not match the expected value."}}
    

Neither test's code path was touched by the PRs whose CI runs surfaced them (#243, #245).

Why this looks systemic rather than one flaky test

This pattern is consistent with the AWS SDK bump in #244 changing some timing/retry behavior (e.g. default retry-on-transient-error) enough that concurrent conditional PUTs against local S3 (LocalStack) no longer reliably resolve to exactly one winner the way these tests assume — rather than either test being inherently flaky on its own.

Suggested next steps

  • Try to reproduce locally by looping the two tests above a few dozen times against LocalStack.
  • Diff the AWS SDK S3 client's default retry/backoff config between the pre- and post-chore: version bumps & RUSTSEC-2026-0258 #244 versions.
  • If confirmed, either adjust the tests to tolerate the SDK's new retry behavior, or pin/configure the S3 client's retry config back to the previous behavior for these conditional-write paths.

Not blocking any specific feature PR — flagging so it doesn't keep silently costing CI reruns on unrelated PRs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions