From d86a8d4a79e7197dc23a0a9e339f385aa9711cac Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 1 Mar 2024 11:24:12 -0700 Subject: [PATCH] op-e2e: Remove global variable Test are run concurrently so accessing shared global object is problematic --- op-e2e/actions/sync_test.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/op-e2e/actions/sync_test.go b/op-e2e/actions/sync_test.go index 13c5839ce4c6..309b10489ec2 100644 --- a/op-e2e/actions/sync_test.go +++ b/op-e2e/actions/sync_test.go @@ -9,7 +9,6 @@ import ( "github.com/ethereum-optimism/optimism/op-batcher/compressor" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils" - "github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-service/eth" @@ -27,10 +26,6 @@ import ( "github.com/stretchr/testify/require" ) -var ( - rollupCfg rollup.Config -) - // TestSyncBatchType run each sync test case in singular batch mode and span batch mode. func TestSyncBatchType(t *testing.T) { tests := []struct { @@ -252,7 +247,7 @@ func TestBackupUnsafe(gt *testing.T) { block = block.WithBody([]*types.Transaction{block.Transactions()[0], invalidTx}, []*types.Header{}) } // Add A1, B2, B3, B4, B5 into the channel - _, err = channelOut.AddBlock(&rollupCfg, block) + _, err = channelOut.AddBlock(sd.RollupCfg, block) require.NoError(t, err) } @@ -424,7 +419,7 @@ func TestBackupUnsafeReorgForkChoiceInputError(gt *testing.T) { block = block.WithBody([]*types.Transaction{block.Transactions()[0], invalidTx}, []*types.Header{}) } // Add A1, B2, B3, B4, B5 into the channel - _, err = channelOut.AddBlock(&rollupCfg, block) + _, err = channelOut.AddBlock(sd.RollupCfg, block) require.NoError(t, err) } @@ -572,7 +567,7 @@ func TestBackupUnsafeReorgForkChoiceNotInputError(gt *testing.T) { block = block.WithBody([]*types.Transaction{block.Transactions()[0], invalidTx}, []*types.Header{}) } // Add A1, B2, B3, B4, B5 into the channel - _, err = channelOut.AddBlock(&rollupCfg, block) + _, err = channelOut.AddBlock(sd.RollupCfg, block) require.NoError(t, err) }