-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix portal & server generate password test sometimes fail #4666
Fix portal & server generate password test sometimes fail #4666
Conversation
2821969
to
e384312
Compare
Thanks for the calculation. But we do not want to modify the original behavior of 10 times. Instead we should make it able to use N instead of 10 in the test only. Can you also apply the same logic to the server generator? They are twin. |
okok, lemme update after linter is ready 🙏 |
e384312
to
b675e0d
Compare
portal/src/util/passwordGenerator.ts
Outdated
@@ -74,9 +74,11 @@ export function generatePasswordWithSource( | |||
|
|||
export function internalGeneratePasswordWithSource( | |||
source: RandSource, | |||
policy: PasswordPolicyConfig | |||
policy: PasswordPolicyConfig, | |||
overrideMaxTrials?: number |
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.
Do not make it optional. Make it required. But the public API must remain unchanged.
b675e0d
to
7002603
Compare
Updated, thanks! CI pass locally |
See `it("should meet the excluded keywords requirement", () => {`
7002603
to
03e1461
Compare
Failing examples
The math
Why it happened
Think it happened at least 3 times since it got merged. Was curious why so I did some math.
0.00630
=test will fail 6 times out of 1000 CI runs
, which is not that unlikely, so it failing 3 times is kind of expected.How to prevent
Say we aim for
only fail once in 100,000 CI runs
Which gives the solution n = 25. So I increased to 25 here
How do I know it works?
Ran below locally, let's see if it fails 🕵️
EDIT2: ran to
816710774 w/o failing, will stop for now