Skip to content
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

ethclient, accounts/keystore: fix flaky tests #23599

Merged
merged 2 commits into from
Sep 20, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Sep 18, 2021

This PR fixes a flaky test, ethclient/gethclient: TestGethClient. The reason it was flaky was that the table-driven test was actually a map-driven test, and the key order when iterating over the map is undefined. Some of the tests (particularly the setHead test) modifies the backend chain, which is problematic for the access list test, which fails if the basefee is too high.

So this PR changes it to use a list instead.

Example failure: https://ci.appveyor.com/project/ethereum/go-ethereum/builds/40814331/job/oh9s50w4lgcxge8d#L821

@holiman
Copy link
Contributor Author

holiman commented Sep 18, 2021

Another failing test:https://ci.appveyor.com/project/ethereum/go-ethereum/builds/40820338/job/4bm6h7cmv95l1u69#L713

This one is due to unixNano mainly being not-nano on windows, so the two tests reuse the same keystore. Fixed by modifying the folder names to no longer collide.

@holiman holiman changed the title ethclient/gethclient: fix flaky test (due to map key ordering) ethclient, accounts/keystore: fix flaky tests Sep 18, 2021
Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman holiman added this to the 1.10.9 milestone Sep 20, 2021
@holiman holiman merged commit 1b34283 into ethereum:master Sep 20, 2021
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
* ethclient/gethclient: fix flaky test (due to map key ordering)

* accounts/keystore: fix test failing due to rand collision due to low time resolution on windows
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.

None yet

2 participants