good morning!!!!

Skip to content
Snippets Groups Projects
Commit 4b2dd447 authored by Péter Szilágyi's avatar Péter Szilágyi
Browse files

eth/downloader: fix throttling test to be less timing dependent

parent 2d627995
No related branches found
No related tags found
No related merge requests found
......@@ -273,9 +273,13 @@ func TestThrottling(t *testing.T) {
}()
// Iteratively take some blocks, always checking the retrieval count
for total := 0; total < targetBlocks; {
// Sleep a bit for sync to complete
time.Sleep(500 * time.Millisecond)
// Wait a bit for sync to complete
for start := time.Now(); time.Since(start) < 3*time.Second; {
time.Sleep(25 * time.Millisecond)
if len(tester.downloader.queue.blockPool) == blockCacheLimit {
break
}
}
// Fetch the next batch of blocks
took := tester.downloader.TakeBlocks()
if len(took) != blockCacheLimit {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment