Skip to content

Stop plain-portal codegen uniqueness test from flaking - #134

Merged
davegaeddert merged 1 commit into
masterfrom
portal-codegen-flake
Sep 20, 2026
Merged

davegaeddert merged 1 commit into
masterfrom
portal-codegen-flake

Conversation

@davegaeddert

Copy link
Copy Markdown
Member

test_generate_many_unique drew 200 random codes and asserted all 200 were distinct. The code space is 99 numbers × 187 × 186 word pairs (about 3.4 million), so by the birthday bound 200 draws collide roughly once in 170 runs. It failed that way on the #89 CI run (assert 199 == 200).

The test now asserts at least 190 of 200 are unique, which still catches a degenerate generator while being effectively impossible to hit by chance.

…llisions

The test drew 200 random codes from a ~3.4 million element space and asserted they were all distinct, which fails about once in 170 runs. Assert nearly-all-unique instead.
@pullapprove5

pullapprove5 Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor
PASS: No review scopes are required

No review scopes matched.

View in PullApprove

Next steps:

@davegaeddert
davegaeddert merged commit 8dded9c into master Sep 20, 2026
9 checks passed
@davegaeddert
davegaeddert deleted the portal-codegen-flake branch September 20, 2026 16:13
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.

1 participant