-
Notifications
You must be signed in to change notification settings - Fork 1
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
NET-111-fixing-flaky-tests #70
Conversation
Ah, I see the CI uses |
test/keys.json
Outdated
{"publicKey":"PHAo3MImPpuEhb8XZahF22Qk_J16XlTIAouOiRaFD-U","privateKey":"UxuhttBGSOBKEJxDsFY_0ypD1n4S4-gGOm56LQ1UfH08cCjcwiY-m4SFvxdlqEXbZCT8nXpeVMgCi46JFoUP5Q"}, | ||
{"publicKey":"qOXEjFdugVUycDSAiPvZdwEd0T2xN2UW7c0xxUuvolc","privateKey":"6yNkzVxrq5zFDukUXGnqd5TF7y7P7RRh_KokP6tLE9So5cSMV26BVTJwNICI-9l3AR3RPbE3ZRbtzTHFS6-iVw"}, | ||
{"publicKey":"y8jnrlMMwqxkWraxr40-xVJfWyszdh4Cxwa4fI-YxaA","privateKey":"IzqVzUrDx_fzWb-B8uZr3N0YMnkB2aHGWtv0Jpqp4R7LyOeuUwzCrGRatrGvjT7FUl9bKzN2HgLHBrh8j5jFoA"} | ||
] |
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.
Instead of storing this json file, you can just quickly generate 1000 keys in memory using the same mnemonic each time.
Something like
const mnemonic = "search topple trouble similar sorry just around connect hello range predict ahead";
const accs = [];
for (let i = 0; i < 1000; i++) {
accs.push(ethers.Wallet.fromMnemonic(mnemonic, `m/44'/60'/0'/${i}`));
}
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.
Then it's easier to change the number of keys to use
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.
Will do
Altered test key generation method from pure random to be from mnemonic.
bb059f5
to
ace214a
Compare
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.
Perfect!
Fixed flaky tests:
should distribute scan results amongst stakees proportionally - all equal
should distribute scan results amongst stakees proportionally - varied stake amounts
Previous random generation method had a failure rate of 6.44%. New method does not fail.
Test Logs: output.zip