test(validator-client): deflake integration test with frozen clock - #24259
Merged
Conversation
The re-execution deadline in validator.integration.test.ts is an absolute
timestamp (the slot attestation deadline) compared against the date
provider's clock. TestDateProvider advances with real wall-clock, so the
~24s slot-1 re-execution budget started ticking at the beforeEach clock
anchor and was consumed by the two heavy validator-context setups before
block re-execution ran. On a loaded CI machine a block that should
re-execute successfully instead hit the deadline, processed 0 txs, and was
rejected as an empty non-first block ("Cannot add empty block that is not
the first block in the checkpoint") -- the same rejection the mana-limit
test expects only for the overflowing block.
Switch the suite to the frozen ManualDateProvider so re-execution never
races real time. The two tests that rely on a retryUntil timing out now
advance the clock past the attestation deadline so the timeout fires
immediately instead of polling the full window.
PhilWindle
approved these changes
Jun 24, 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.
Motivation
ValidatorClient Integration(validator.integration.test.ts) flakes (~7 failures acrossnextandmerge-train/spartan-v5). The block re-execution deadline is the slot attestation deadline (~24s) checked against the date provider's clock.TestDateProvideradvances with real wall-clock from thebeforeEachanchor, so the budget is consumed by the two heavy fixture setups before re-execution runs. On a slow CI box a block that should re-execute hits the deadline, processes 0 txs, and is rejected as an empty non-first block — the rejection the mana-limit test expects only for the overflowing block.Approach
Use the frozen
ManualDateProviderso re-execution can't race wall-clock. The two tests that depend on aretryUntiltiming out now advance the clock past the attestation deadline so the timeout fires immediately instead of polling the full window. No assertion changed.Changes
validator.integration.test.tsusesManualDateProvider; two timeout-dependent tests advance the clock past the deadline.Fixes A-1265