-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Crypto] improve flaky random test #2509
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2509 +/- ##
=======================================
Coverage 56.93% 56.93%
=======================================
Files 656 656
Lines 60328 60328
=======================================
Hits 34349 34349
Misses 23033 23033
Partials 2946 2946
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
If I have the correct test (TestUint), this test has been consistently passing in the Flaky Test Monitor: Where have you seen the flaky behavior? |
@gomisha this test started failed a few times on feature branch for Active Pacemaker. Here one if the evidences: https://github.com/onflow/flow-go/runs/6622170032?check_suite_focus=true |
The test is probabilistic and there is always a low chance of failure, failures should happen very rarely. I'm also surprised it happens "a few times" on the feature branch. |
crand.Read(seed) | ||
rand.Read(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why replacing crypto/rand with math/rand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
math/rand
produces deterministic randoms depending on the initializing seed, while crypto/rand
doesn't allow that. This is useful when a test fails, and by logging the seed we can reproduce the fail.
Note that math/rand
shouldn't be used outside of tests when secure entropy is needed.
bors merge |
A rare flakiness has been seen in a statistical tests under crypto/random
cc @durkmurder