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
@holiman holiman force-pushed the fix_gethclient_flakeytest branch from 7854516 to 6473dcd Compare September 18, 2021 21:39
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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@holiman holiman force-pushed the fix_gethclient_flakeytest branch from 6473dcd to 1ecf179 Compare September 20, 2021 07:41
@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
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jan 8, 2025
* 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
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jan 8, 2025
* 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
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jan 9, 2025
* 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
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jan 10, 2025
* 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
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jan 10, 2025
* 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
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jan 10, 2025
* 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
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jan 10, 2025
* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 14, 2025
* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 16, 2025
* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 17, 2025
* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 22, 2025
* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 22, 2025
* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 23, 2025
* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 24, 2025
* 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