Skip to content

Commit f961472

Browse files
committed
Wait for devent to start up
1 parent 88186fd commit f961472

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

espresso/devnet-tests/batcher_restart_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ func testRestart(t *testing.T, tee bool) {
3131
require.NoError(t, d.Down())
3232
}()
3333

34+
require.NoError(t, d.WaitForL2Operational())
35+
3436
// Send a transaction just to check that everything has started up ok.
3537
require.NoError(t, d.RunSimpleL2Burn())
3638

espresso/devnet-tests/devnet_tools.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"time"
1717

1818
"github.com/ethereum-optimism/optimism/op-e2e/bindings"
19+
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
1920
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
2021
"github.com/ethereum-optimism/optimism/op-e2e/system/helpers"
2122
"github.com/ethereum-optimism/optimism/op-node/rollup"
@@ -278,6 +279,19 @@ func (d *Devnet) Up() (err error) {
278279
return nil
279280
}
280281

282+
func (d *Devnet) WaitForL2Operational() error {
283+
284+
timeout := time.Minute * 5
285+
286+
// Batcher needs more time to startup in tee
287+
if d.getProfile() == "tee" {
288+
timeout = time.Minute * 10
289+
}
290+
291+
_, err := geth.WaitForBlockToBeSafe(big.NewInt(1), d.L2Verif, timeout)
292+
return err
293+
}
294+
281295
func (d *Devnet) ServiceUp(service Service) error {
282296
serviceName := d.getServiceName(service)
283297
log.Info("bringing up service", "service", serviceName)

0 commit comments

Comments
 (0)