Skip to content

test(core): concurrent takeover claim test can see two winners when spawns are skewed #278

Closed

Description

@ElbertePlinio

Found during the post-#253 flake re-check.

packages/core/test/takeover.test.ts "two concurrent claims yield exactly one winner" failed once: expected [ { won: true, … }, … ] to have a length of 1 but got 2. Each worker in test/workers/takeover-acquire-worker.ts holds the lease for 150 ms and then releases it. If the second bun process starts more than 150 ms after the first, it claims a free lease, so both report a win without any overlap. That is a test timing assumption, not proof that the wx claim protocol failed. The test should still be checked for a real overlap.

Evidence: 4 rounds of two concurrent full suites on main be2d00c after the host RTTIME fix (#253), logs in the local flake re-check artifacts.

  • Confirm whether the two claims overlapped (for example record claim and release times)
  • Make the workers start their claims together (a barrier file) or hold the lease until both have claimed
  • Repeat-run evidence under load

Activity

  1. added
    bug
    on Oct 7, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions