diff options
author | Felix Lange <fjl@twurst.com> | 2016-06-13 18:55:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-13 18:55:32 +0800 |
commit | 73c028c40a4f1336a0ab4b9773be0a9d7719777f (patch) | |
tree | 92f07a81f8bc4ca6c6ea63d055311a0c371662c4 /eth | |
parent | ce88d41907f0cb1146a2f7228ccd61669f8d8b91 (diff) | |
parent | 783289068a63b3accbc6d69cb0ecc0f2c39c5f54 (diff) | |
download | go-tangerine-73c028c40a4f1336a0ab4b9773be0a9d7719777f.tar go-tangerine-73c028c40a4f1336a0ab4b9773be0a9d7719777f.tar.gz go-tangerine-73c028c40a4f1336a0ab4b9773be0a9d7719777f.tar.bz2 go-tangerine-73c028c40a4f1336a0ab4b9773be0a9d7719777f.tar.lz go-tangerine-73c028c40a4f1336a0ab4b9773be0a9d7719777f.tar.xz go-tangerine-73c028c40a4f1336a0ab4b9773be0a9d7719777f.tar.zst go-tangerine-73c028c40a4f1336a0ab4b9773be0a9d7719777f.zip |
Merge pull request #2687 from karalabe/downloader-fasttest-fix
eth/downloader: fix occasional fast sync critical section test fails
Diffstat (limited to 'eth')
-rw-r--r-- | eth/downloader/downloader_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index a9c069a92..e9e051ded 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -1824,13 +1824,15 @@ func testFastCriticalRestarts(t *testing.T, protocol int) { for i := 0; i < fsPivotInterval; i++ { tester.peerMissingStates["peer"][headers[hashes[fsMinFullBlocks+i]].Root] = true } + tester.downloader.dropPeer = func(id string) {} // We reuse the same "faulty" peer throughout the test + // Synchronise with the peer a few times and make sure they fail until the retry limit for i := 0; i < fsCriticalTrials; i++ { // Attempt a sync and ensure it fails properly if err := tester.sync("peer", nil, FastSync); err == nil { t.Fatalf("failing fast sync succeeded: %v", err) } - time.Sleep(500 * time.Millisecond) // Make sure no in-flight requests remain + time.Sleep(100 * time.Millisecond) // Make sure no in-flight requests remain // If it's the first failure, pivot should be locked => reenable all others to detect pivot changes if i == 0 { |