@@ -39,9 +39,16 @@ func TestTxGossipingMultipleNodesNoDA(t *testing.T) {
3939 // Verify block manager is properly initialized
4040 require .NotNil (nodes [0 ].blockManager , "Block manager should be initialized" )
4141
42+ // Add a small delay to ensure P2P services are fully ready
43+ time .Sleep (500 * time .Millisecond )
44+
4245 // Start the other nodes
4346 for i := 1 ; i < numNodes ; i ++ {
4447 startNodeInBackground (t , nodes , ctxs , & runningWg , i )
48+ // Add a small delay between starting nodes to avoid connection race
49+ if i < numNodes - 1 {
50+ time .Sleep (100 * time .Millisecond )
51+ }
4552 }
4653
4754 // Inject a transaction into the sequencer's executor
@@ -88,9 +95,16 @@ func TestTxGossipingMultipleNodesDAIncluded(t *testing.T) {
8895 // Verify block manager is properly initialized
8996 require .NotNil (nodes [0 ].blockManager , "Block manager should be initialized" )
9097
98+ // Add a small delay to ensure P2P services are fully ready
99+ time .Sleep (500 * time .Millisecond )
100+
91101 // Start the other nodes
92102 for i := 1 ; i < numNodes ; i ++ {
93103 startNodeInBackground (t , nodes , ctxs , & runningWg , i )
104+ // Add a small delay between starting nodes to avoid connection race
105+ if i < numNodes - 1 {
106+ time .Sleep (100 * time .Millisecond )
107+ }
94108 }
95109
96110 // Inject a transaction into the sequencer's executor
@@ -142,6 +156,9 @@ func TestFastDASync(t *testing.T) {
142156 blocksToWaitFor := uint64 (2 )
143157 require .NoError (waitForAtLeastNDAIncludedHeight (nodes [0 ], blocksToWaitFor ))
144158
159+ // Add a small delay to ensure P2P services are fully ready
160+ time .Sleep (500 * time .Millisecond )
161+
145162 // Now start the second node and time its sync
146163 startNodeInBackground (t , nodes , ctxs , & runningWg , 1 )
147164 start := time .Now ()
@@ -186,9 +203,16 @@ func TestSingleSequencerTwoFullNodesBlockSyncSpeed(t *testing.T) {
186203 // Wait for the sequencer to produce at first block
187204 require .NoError (waitForFirstBlock (nodes [0 ], Store ))
188205
206+ // Add a small delay to ensure P2P services are fully ready
207+ time .Sleep (500 * time .Millisecond )
208+
189209 // Now start the other nodes
190210 for i := 1 ; i < numNodes ; i ++ {
191211 startNodeInBackground (t , nodes , ctxs , & runningWg , i )
212+ // Add a small delay between starting nodes to avoid connection race
213+ if i < numNodes - 1 {
214+ time .Sleep (100 * time .Millisecond )
215+ }
192216 }
193217
194218 blocksToWaitFor := uint64 (10 )
@@ -274,6 +298,9 @@ func testSingleSequencerSingleFullNode(t *testing.T, source Source) {
274298 // Wait for the sequencer to produce at first block
275299 require .NoError (waitForFirstBlock (nodes [0 ], source ))
276300
301+ // Add a small delay to ensure P2P services are fully ready
302+ time .Sleep (500 * time .Millisecond )
303+
277304 // Start the full node
278305 startNodeInBackground (t , nodes , ctxs , & runningWg , 1 )
279306
@@ -312,9 +339,16 @@ func testSingleSequencerTwoFullNodes(t *testing.T, source Source) {
312339 // Wait for the sequencer to produce at first block
313340 require .NoError (waitForFirstBlock (nodes [0 ], source ))
314341
342+ // Add a small delay to ensure P2P services are fully ready
343+ time .Sleep (500 * time .Millisecond )
344+
315345 // Start the full nodes
316346 for i := 1 ; i < numNodes ; i ++ {
317347 startNodeInBackground (t , nodes , ctxs , & runningWg , i )
348+ // Add a small delay between starting nodes to avoid connection race
349+ if i < numNodes - 1 {
350+ time .Sleep (100 * time .Millisecond )
351+ }
318352 }
319353
320354 blocksToWaitFor := uint64 (3 )
@@ -372,6 +406,9 @@ func testSingleSequencerSingleFullNodeTrustedHash(t *testing.T, source Source) {
372406 // Set the trusted hash in the full node
373407 nodes [1 ].nodeConfig .Node .TrustedHash = trustedHash
374408
409+ // Add a small delay to ensure P2P services are fully ready
410+ time .Sleep (500 * time .Millisecond )
411+
375412 // Start the full node
376413 startNodeInBackground (t , nodes , ctxs , & runningWg , 1 )
377414
0 commit comments