fix(ethereum): deflake monitor timeout tests in l1_tx_utils#24545
Merged
spalladino merged 1 commit intoJul 6, 2026
Merged
Conversation
bb86cf0 to
7d1c105
Compare
spalladino
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
l1_tx_utils.test.tsflaked in CI (log, seen on #24454, which is unrelated to the failure). The failing test wasmonitors all sent txs:Root cause
The test creates the monitor promise and only attaches its rejection expectation after several intervening awaits:
Anvil timestamps have 1s granularity, so when the wall clock crosses a second boundary between the send and the monitor's timeout check, the monitor (with
txTimeoutMs: 200,checkIntervalMs: 100) can observe the L1 timestamp already 1s pastsentAtand reject beforemineEmptyBlock()completes. In the failing run the timeout fired at16:41:20.355, before the empty block was mined at.356and before the.rejectshandler attached at.357. Node emittedunhandledRejectionin that window and jest 30 reported it as the test failure — which is why the failure stack has no test-file frame and the test's own assertions all passed in the log.The same file already uses the safe idiom in a dozen newer tests: attach the handler synchronously with
.catch(err => err)and assert viaresolves.toBeInstanceOf(TimeoutError).Fix
Apply that established pattern to the three remaining tests that expect a monitor timeout but attach the handler only after intervening awaits:
stops trying after timeout once block is minedattempts to cancel timed out transactionsmonitors all sent txs(the observed flake)Test-only change; no product code touched.
TimeoutErroris exactly whatmonitorTransactionthrows on timeout, so the assertions are equivalent-or-stricter than the previous message matching.Evidence: CI log http://ci.aztec-labs.com/390c881d64e094b6 (search for
monitors all sent txs).Created by claudebox · group:
slackbot