Skip to content

eth/downloader: Updated downloader tests to improve perf and reliability#15337

Merged
fjl merged 2 commits into
ethereum:masterfrom
Consensys:downloader-tests-fixes
Dec 1, 2017
Merged

eth/downloader: Updated downloader tests to improve perf and reliability#15337
fjl merged 2 commits into
ethereum:masterfrom
Consensys:downloader-tests-fixes

Conversation

@rojotek
Copy link
Copy Markdown
Contributor

@rojotek rojotek commented Oct 19, 2017

eth/downloader: Updated use of Parallel and added some subtests to help isolate them.
Increased timeout in floodingTestPeer.RequestHeadersByNumber, so that it
doesn't accidently timeout and cause other tests to break.

@GitCop
Copy link
Copy Markdown

GitCop commented Oct 23, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: b464648640bda179fac278ef3bcba0f99559fb6e
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

Updated use of Parallel and added some subtests to help isolate them.
Increased timeout in floodingTestPeer.RequestHeadersByNumber, so that it
doesn't accidently timeout and cause other tests to break.
Extra sleep for the first failure in TestFastCriticalRestarts.
@rojotek rojotek force-pushed the downloader-tests-fixes branch from b464648 to 35d587b Compare October 23, 2017 21:09
@rojotek
Copy link
Copy Markdown
Contributor Author

rojotek commented Oct 24, 2017

GitCop message has been adressed by squashing commits together. Current failing test is far away from fixes included in this commit.

Comment thread eth/downloader/downloader_test.go Outdated
// We use data driven subtests to manage this so that it will be parallel on its own
// and not with the other tests, avoiding intermittent failures.
func TestDeliverHeadersHang(t *testing.T) {
testCases :=[]struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you forgot a space after :=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should use gofmt to avoid those kind of issues.

Comment thread eth/downloader/downloader_test.go Outdated
// We use data driven subtests to manage this so that it will be parallel on its own
// and not with the other tests, avoiding intermittent failures.
func TestFastCriticalRestarts(t *testing.T) {
testCases :=[]struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another space missing here.

func TestDeliverHeadersHang64Fast(t *testing.T) { testDeliverHeadersHang(t, 64, FastSync) }
func TestDeliverHeadersHang64Light(t *testing.T) { testDeliverHeadersHang(t, 64, LightSync) }
// We use data driven subtests to manage this so that it will be parallel on its own
// and not with the other tests, avoiding intermittent failures.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why does running these tests synchronously cause intermittent failures?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't have a deep understanding, but suspect that a timeout in a different test was interacting badly with these. There is still parallel tests being run, with all the header tests running in parallel, but not in parallel with the other tests.

@rojotek
Copy link
Copy Markdown
Contributor Author

rojotek commented Nov 5, 2017

@armaniferrante @mexskican I've done the formatting fixes, and added a comment about the parallel, please let me know if you have any additional feedback.

@armaniferrante
Copy link
Copy Markdown
Contributor

Looks good to me, though I'm uncertain about the two time related changes. Someone more familiar should also take a look as well.


// If it's the first failure, pivot should be locked => reenable all others to detect pivot changes
if i == 0 {
time.Sleep(150 * time.Millisecond) // Make sure no in-flight requests remain
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you look at the lines of code just below, there is a sleep directly before failing. I found that moving the sleep to just before the explicit fail was a better place to have it, and made the test more reliable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@fjl Hi, just checking in to see if you saw my reply to your comment?

@fjl fjl merged commit d927c67 into ethereum:master Dec 1, 2017
@karalabe karalabe added this to the 1.8.0 milestone Dec 14, 2017
trung added a commit to trung/quorum that referenced this pull request Sep 9, 2018
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.

6 participants