diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 1d0dcae0c7..9eebc973dc 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -216,10 +216,12 @@ func TestNoInsertPastL2MigrationBlock(t *testing.T) { migrationBlock := 2 blockchain.chainConfig.L2MigrationBlock = big.NewInt(int64(migrationBlock)) - blocks := makeBlockChain(blockchain.CurrentBlock(), 100000000, mockEngine.NewFullFaker(), blockchain.db, 0) + blocks := makeBlockChain(blockchain.CurrentBlock(), 1000000, mockEngine.NewFullFaker(), blockchain.db, 0) failedBlock, err := blockchain.InsertChain(blocks) require.EqualError(t, err, errInsertionInterrupted.Error()) + // Compare with migrationBlock-1 because failedBlock is the index of the failed block in the blocks[] array, not in the actual blockchain. require.EqualValues(t, migrationBlock-1, failedBlock) + // Only the first block in blocks[] should be inserted if blocks[migrationBlock-2].Hash() != rawdb.ReadHeadBlockHash(blockchain.db) { t.Fatalf("Write/Get HeadBlockHash failed") } diff --git a/e2e_test/e2e_test.go b/e2e_test/e2e_test.go index 805ce6d0be..06875b8c3d 100644 --- a/e2e_test/e2e_test.go +++ b/e2e_test/e2e_test.go @@ -423,7 +423,7 @@ func TestStopNetworkAtL2Block(t *testing.T) { require.NoError(t, err) defer shutdown() - ctx, cancel := context.WithTimeout(context.Background(), time.Second*100) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*400) defer cancel() runStopNetworkAtL2BlockTest(ctx, t, network, l2BlockOG)