Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions l2gersync/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ const (
maxRetryAttemptsAfterError = 10
waitForNewBlocksPeriod = 30 * time.Millisecond
syncBlockChunkSize = 10
testIterations = 3
syncDelay = 1 * time.Second
testIterations = 5
syncDelay = 500 * time.Millisecond
)

func TestL2GERSyncE2E(t *testing.T) {
t.Parallel()
t.Skip("Skipping E2E test, this test is broken and needs a PR to be fixed. The lastProcessedBlock doesn't take in account empty blocks")

ctx, _ := context.WithTimeout(context.Background(), 30*time.Minute)

l1Setup, l2Setup := helpers.NewSimulatedEVMEnvironment(t, helpers.DefaultEnvironmentConfig(helpers.SovereignChainL2GERContract))
Expand All @@ -56,15 +54,12 @@ func TestL2GERSyncE2E(t *testing.T) {

for i := range testIterations {
updateL1GlobalExitRoot(t, l1Setup, i)
time.Sleep(15 * syncDelay)
testGERSyncer(t, ctx, l1Setup, l2Setup, syncer, i)
}
}

func TestL2GERSync_GERRemoval(t *testing.T) {
t.Parallel()
t.Skip("Skipping E2E test, this test is broken and needs a PR to be fixed. The lastProcessedBlock doesn't take in account empty blocks")

ctx := t.Context()
l1Environment, l2Environment := helpers.NewSimulatedEVMEnvironment(t, helpers.DefaultEnvironmentConfig(helpers.SovereignChainL2GERContract))

Expand Down Expand Up @@ -92,7 +87,6 @@ func TestL2GERSync_GERRemoval(t *testing.T) {
for i := range testIterations {
ger := updateL1GlobalExitRoot(t, l1Environment, i)
updatedGERs = append(updatedGERs, ger)
time.Sleep(syncDelay)
testGERSyncer(t, ctx, l1Environment, l2Environment, syncer, i)
}

Expand Down Expand Up @@ -127,8 +121,6 @@ func TestL2GERSync_GERRemoval(t *testing.T) {

func TestL2GERSync_IndexLegacyGERManagerSC(t *testing.T) {
t.Parallel()
t.Skip("Skipping E2E test, this test is broken and needs a PR to be fixed. The lastProcessedBlock doesn't take in account empty blocks")

ctx := context.Background()
l1Setup, l2Setup := helpers.NewSimulatedEVMEnvironment(t, helpers.DefaultEnvironmentConfig(helpers.LegacyL2GERContract))

Expand Down Expand Up @@ -161,9 +153,9 @@ func TestL2GERSync_IndexLegacyGERManagerSC(t *testing.T) {
time.Sleep(syncDelay)
}

l1Setup.SimBackend.Commit()
l2Setup.SimBackend.Commit()
time.Sleep(1 * time.Second)
// l1Setup.SimBackend.Commit()
// l2Setup.SimBackend.Commit()
// time.Sleep(1 * time.Second)

endBlockNumber, err := l2Setup.SimBackend.Client().BlockNumber(ctx)
require.NoError(t, err)
Expand Down Expand Up @@ -214,7 +206,7 @@ func testGERSyncer(t *testing.T, ctx context.Context,
l1Setup *helpers.L1Environment, l2Setup *helpers.L2Environment,
syncer *l2gersync.L2GERSync, i int) {
t.Helper()
time.Sleep(2 * time.Second)
time.Sleep(500 * time.Millisecond)

expectedGER, err := l1Setup.GERContract.GetLastGlobalExitRoot(&bind.CallOpts{Pending: false})
require.NoError(t, err)
Expand Down
Loading