Skip to content

Commit fe0037f

Browse files
tac0turtletac0turtle
andauthored
fix: flaky testTwoChainsInOneNamespace (#2465)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview This pr reduces resources in order to avoid failing in ci <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated integration test to run only sequencer nodes per chain, removing full node setup and related synchronization checks. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: tac0turtle <you@example.com>
1 parent 80178ab commit fe0037f

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

node/full_node_integration_test.go

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ func TestTwoChainsInOneNamespace(t *testing.T) {
414414
}
415415
}
416416

417-
// testTwoChainsInOneNamespace sets up two chains in the same namespace, starts the sequencers, waits for blocks, then starts the full nodes.
417+
// testTwoChainsInOneNamespace sets up two chains in the same namespace, starts the sequencers, and waits for blocks.
418418
// It waits for all nodes to reach a target block height, and verifies that all nodes are fully synced, and then shuts them down.
419419
func testTwoChainsInOneNamespace(t *testing.T, chainID1 string, chainID2 string) {
420420
require := require.New(t)
@@ -423,8 +423,7 @@ func testTwoChainsInOneNamespace(t *testing.T, chainID1 string, chainID2 string)
423423
configChain1 := getTestConfig(t, 1)
424424
configChain1.ChainID = chainID1
425425

426-
numNodes := 2
427-
nodes1, cleanups := createNodesWithCleanup(t, numNodes, configChain1)
426+
nodes1, cleanups := createNodesWithCleanup(t, 1, configChain1)
428427
for _, cleanup := range cleanups {
429428
defer cleanup()
430429
}
@@ -433,14 +432,13 @@ func testTwoChainsInOneNamespace(t *testing.T, chainID1 string, chainID2 string)
433432
configChain2 := getTestConfig(t, 1000)
434433
configChain2.ChainID = chainID2
435434

436-
numNodes = 2
437-
nodes2, cleanups := createNodesWithCleanup(t, numNodes, configChain2)
435+
nodes2, cleanups := createNodesWithCleanup(t, 1, configChain2)
438436
for _, cleanup := range cleanups {
439437
defer cleanup()
440438
}
441439

442440
// Set up context and wait group for the sequencer of chain 1
443-
ctxs1, cancels1 := createNodeContexts(numNodes)
441+
ctxs1, cancels1 := createNodeContexts(1)
444442
var runningWg1 sync.WaitGroup
445443

446444
// Start the sequencer of chain 1
@@ -450,7 +448,7 @@ func testTwoChainsInOneNamespace(t *testing.T, chainID1 string, chainID2 string)
450448
require.NoError(waitForFirstBlock(nodes1[0], Store))
451449

452450
// Set up context and wait group for the sequencer of chain 2
453-
ctxs2, cancels2 := createNodeContexts(numNodes)
451+
ctxs2, cancels2 := createNodeContexts(1)
454452
var runningWg2 sync.WaitGroup
455453

456454
// Start the sequencer of chain 2
@@ -459,23 +457,13 @@ func testTwoChainsInOneNamespace(t *testing.T, chainID1 string, chainID2 string)
459457
// Wait for the sequencer to produce at first block
460458
require.NoError(waitForFirstBlock(nodes2[0], Store))
461459

462-
// Start the full node of chain 1
463-
startNodeInBackground(t, nodes1, ctxs1, &runningWg1, 1)
464-
465-
// Start the full node of chain 2
466-
startNodeInBackground(t, nodes2, ctxs2, &runningWg2, 1)
467-
468460
blocksToWaitFor := uint64(3)
469461

470462
// Wait for the full node of chain 1 to reach at least blocksToWaitFor blocks
471-
require.NoError(waitForAtLeastNBlocks(nodes1[1], blocksToWaitFor, Store))
463+
require.NoError(waitForAtLeastNBlocks(nodes1[0], blocksToWaitFor, Store))
472464

473465
// Wait for the full node of chain 2 to reach at least blocksToWaitFor blocks
474-
require.NoError(waitForAtLeastNBlocks(nodes2[1], blocksToWaitFor, Store))
475-
476-
// Verify both full nodes are synced using the helper
477-
require.NoError(verifyNodesSynced(nodes1[0], nodes1[1], Store))
478-
require.NoError(verifyNodesSynced(nodes2[0], nodes2[1], Store))
466+
require.NoError(waitForAtLeastNBlocks(nodes2[0], blocksToWaitFor, Store))
479467

480468
// Cancel all node contexts to signal shutdown and wait for both chains
481469
shutdownAndWait(t, cancels1, &runningWg1, 5*time.Second)

0 commit comments

Comments
 (0)