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

eth/downloader: fix flaky test #29852

Merged
merged 2 commits into from
May 27, 2024

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented May 27, 2024

This pull request fixes the flay test TestSkeletonSyncRetrievals. In this test, we first trigger a sync cycle and wait for it to meet certain expectations. We then inject a new head and potentially also a new peer, then perform another final sync. The test now performs the newPeer addition before launching the final sync, and waits a bit for that peer to get registered. This fixes the logic race that made the test fail sometimes.

The potential test error could be:

--- FAIL: TestSkeletonSyncRetrievals (5.15s)
    skeleton_test.go:948: test 0, end state: subchain 0 head mismatch: have 5001, want 5003
FAIL

--- FAIL: TestSkeletonSyncRetrievals (0.84s)
    skeleton_test.go:908: test 5, mid state: dropped peers mismatch: have 0, want 1
FAIL

@fjl fjl changed the title eth/downloader: fix flay test eth/downloader: fix flaky test May 27, 2024
@fjl
Copy link
Contributor

fjl commented May 27, 2024

@gballet and me also did a bit of refactoring here to improve the test structure. It had a lot of repeated code.

@fjl fjl merged commit 5132768 into ethereum:master May 27, 2024
2 of 3 checks passed
@fjl fjl added this to the 1.14.4 milestone May 27, 2024
jorgemmsilva pushed a commit to iotaledger/go-ethereum that referenced this pull request Jun 17, 2024
This pull request fixes the flay test TestSkeletonSyncRetrievals. In this test, we first
trigger a sync cycle and wait for it to meet certain expectations. We then inject a new
head and potentially also a new peer, then perform another final sync. The test now
performs the newPeer addition before launching the final sync, and waits a bit for that
peer to get registered. This fixes the logic race that made the test fail sometimes.

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
stwiname pushed a commit to subquery/data-node-go-ethereum that referenced this pull request Sep 9, 2024
This pull request fixes the flay test TestSkeletonSyncRetrievals. In this test, we first
trigger a sync cycle and wait for it to meet certain expectations. We then inject a new
head and potentially also a new peer, then perform another final sync. The test now
performs the newPeer addition before launching the final sync, and waits a bit for that
peer to get registered. This fixes the logic race that made the test fail sometimes.

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
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.

3 participants