diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-06-13 18:01:19 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-06-13 18:04:19 +0800 |
commit | 783289068a63b3accbc6d69cb0ecc0f2c39c5f54 (patch) | |
tree | 92f07a81f8bc4ca6c6ea63d055311a0c371662c4 /eth/downloader | |
parent | ce88d41907f0cb1146a2f7228ccd61669f8d8b91 (diff) | |
download | go-tangerine-783289068a63b3accbc6d69cb0ecc0f2c39c5f54.tar go-tangerine-783289068a63b3accbc6d69cb0ecc0f2c39c5f54.tar.gz go-tangerine-783289068a63b3accbc6d69cb0ecc0f2c39c5f54.tar.bz2 go-tangerine-783289068a63b3accbc6d69cb0ecc0f2c39c5f54.tar.lz go-tangerine-783289068a63b3accbc6d69cb0ecc0f2c39c5f54.tar.xz go-tangerine-783289068a63b3accbc6d69cb0ecc0f2c39c5f54.tar.zst go-tangerine-783289068a63b3accbc6d69cb0ecc0f2c39c5f54.zip |
eth/downloader: fix occasional fast sync critical section test fails
Diffstat (limited to 'eth/downloader')
-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 { |