Skip to content

Commit

Permalink
Add a hacky sleep
Browse files Browse the repository at this point in the history
Reviewers, please tell me the "right" way to ensure that the
transaction is visible in the L1. I don't like the idea of adding
sleeps in tests to ensure that some event has occurred. Is there some
RPC I can call or event I can subscribe to that I can then wait for
before proceeding?
  • Loading branch information
eljobe committed Aug 23, 2024
1 parent 20b6790 commit 1a353b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system_tests/program_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ func storageTest(t *testing.T, jit bool) {
assertStorageAt(t, ctx, l2client, programAddress, key, value)

validateBlocks(t, 2, jit, builder)
// Without this sleep, this test fails in the "-race" CI builds complaining that
// the block has not been seen in L1 yet.
time.Sleep(10 * time.Second)
// Captures a block_input_<id>.json file for the block that included the
// storage write transaction.
recordBlock(t, receipt.BlockNumber.Uint64(), builder)
Expand Down

0 comments on commit 1a353b2

Please sign in to comment.