Skip to content

Commit

Permalink
op-e2e: Remove global variable
Browse files Browse the repository at this point in the history
Test are run concurrently so accessing shared global object is problematic
  • Loading branch information
pcw109550 committed Mar 1, 2024
1 parent da64a2b commit d86a8d4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions op-e2e/actions/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit d86a8d4

Please sign in to comment.