Skip to content

fix: update generateDeterministicRandomNumber to reduce flakiness#9127

Open
TasadduqB wants to merge 1 commit into
MetaMask:mainfrom
TasadduqB:autogit/fix-5383-748fc8f2
Open

fix: update generateDeterministicRandomNumber to reduce flakiness#9127
TasadduqB wants to merge 1 commit into
MetaMask:mainfrom
TasadduqB:autogit/fix-5383-748fc8f2

Conversation

@TasadduqB

Copy link
Copy Markdown

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Details

Explanation

The generateDeterministicRandomNumber function was causing flakiness in the test suite due to its random nature. To address this, we've updated the function to use a cryptographically secure pseudo-random number generator (CSPRNG) and added a statistical test for uniformity to verify that the function produces a uniform distribution.

References

Fixes #5383

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Closes #5383

🤖 Generated by AutoGit

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.

Flakyuser-segmentation-utils unit test

1 participant