diff --git a/eth/sync_test.go b/eth/sync_test.go index 4e874a8b39..dc295f2790 100644 --- a/eth/sync_test.go +++ b/eth/sync_test.go @@ -88,8 +88,10 @@ func testSnapSyncDisabling(t *testing.T, ethVer uint, snapVer uint) { if err := empty.handler.downloader.BeaconSync(ethconfig.SnapSync, full.chain.CurrentBlock(), nil); err != nil { t.Fatal("sync failed:", err) } - // Wait for downloader to finish processing with a timeout - for timeout := time.After(5 * time.Second); ; { + // Downloader internally has to wait for a timer (3s) to be expired before + // exiting. Poll after to determine if sync is disabled. + time.Sleep(time.Second * 3) + for timeout := time.After(time.Second); ; { select { case <-timeout: t.Fatalf("snap sync not disabled after successful synchronisation")