Skip to content

fix flaky test#586

Merged
morgo merged 2 commits intoblock:mainfrom
morgo:fix-flaky-test
Jan 30, 2026
Merged

fix flaky test#586
morgo merged 2 commits intoblock:mainfrom
morgo:fix-flaky-test

Conversation

@morgo
Copy link
Collaborator

@morgo morgo commented Jan 30, 2026

A Pull Request should be associated with an Issue.

We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
and potentially we'll be able to point development in a particular direction.
Further notes in https://github.com/block/spirit/blob/main/.github/CONTRIBUTING.md

Fixes #585

This test was introduced in #564 - the fix is still good enough.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a flaky test (TestNewServerIDConcurrent) that was failing intermittently due to the birthday paradox when generating 10,000 IDs from a ~4.3 billion value range. The fix allows up to 1 duplicate ID occurrence instead of requiring all 10,000 IDs to be unique, reducing the test failure rate from ~1.16% to ~0.0067% (172x improvement).

Changes:

  • Modified the test to track and count duplicate IDs instead of immediately failing on first duplicate
  • Added tolerance for 1 duplicate ID to account for birthday paradox probability
  • Added documentation explaining the birthday paradox and the rationale for allowing duplicates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@morgo morgo merged commit 88b0aad into block:main Jan 30, 2026
13 checks passed
@morgo morgo deleted the fix-flaky-test branch January 30, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestNewServerIDConcurrent is flaky

3 participants