From 1c57917465bef13a431c3b317a40661bdac5ec6d Mon Sep 17 00:00:00 2001 From: Avory Date: Tue, 26 Aug 2025 10:00:51 +0300 Subject: [PATCH] Update sync_test.go --- eth/sync_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eth/sync_test.go b/eth/sync_test.go index cad3a4732e..359342b3fd 100644 --- a/eth/sync_test.go +++ b/eth/sync_test.go @@ -88,7 +88,12 @@ 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) } - time.Sleep(time.Second * 5) // Downloader internally has to wait a timer (3s) to be expired before exiting + // Wait for downloader to finish processing with a timeout + for t0 := time.Now(); time.Since(t0) < 10*time.Second; time.Sleep(100 * time.Millisecond) { + if !empty.handler.snapSync.Load() { + break + } + } if empty.handler.snapSync.Load() { t.Fatalf("snap sync not disabled after successful synchronisation")