diff --git a/eth/handler_eth_test.go b/eth/handler_eth_test.go index 534b72b865..c35bf0f4ce 100644 --- a/eth/handler_eth_test.go +++ b/eth/handler_eth_test.go @@ -633,6 +633,9 @@ func testBroadcastBlock(t *testing.T, peers, bcasts int) { go source.handler.runEthPeer(sourcePeer, func(peer *eth.Peer) error { return eth.Handle((*ethHandler)(source.handler), peer) }) + // Wait a bit for the above handlers to start + time.Sleep(100 * time.Millisecond) + if err := sinkPeer.Handshake(1, td, genesis.Hash(), genesis.Hash(), forkid.NewIDWithChain(source.chain), forkid.NewFilter(source.chain), nil); err != nil { t.Fatalf("failed to run protocol handshake") } diff --git a/eth/sync_test.go b/eth/sync_test.go index d846e06abb..195d2fd2ae 100644 --- a/eth/sync_test.go +++ b/eth/sync_test.go @@ -151,6 +151,8 @@ func testChainSyncWithBlobs(t *testing.T, mode downloader.SyncMode, preCancunBlk go full.handler.runEthPeer(fullPeerEth, func(peer *eth.Peer) error { return eth.Handle((*ethHandler)(full.handler), peer) }) + // Wait a bit for the above handlers to start + time.Sleep(250 * time.Millisecond) emptyPipeSnap, fullPipeSnap := p2p.MsgPipe() defer emptyPipeSnap.Close()