Skip to content

test(validator-client): deflake integration test with frozen clock - #24259

Merged
PhilWindle merged 1 commit into
merge-train/spartan-v5from
spl/a-1265-deflake-validator
Jun 24, 2026
Merged

test(validator-client): deflake integration test with frozen clock#24259
PhilWindle merged 1 commit into
merge-train/spartan-v5from
spl/a-1265-deflake-validator

Conversation

@spalladino

@spalladino spalladino commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Motivation

ValidatorClient Integration (validator.integration.test.ts) flakes (~7 failures across next and merge-train/spartan-v5). The block re-execution deadline is the slot attestation deadline (~24s) checked against the date provider's clock. TestDateProvider advances with real wall-clock from the beforeEach anchor, 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 ManualDateProvider so re-execution can't race wall-clock. The two tests that depend on a retryUntil timing 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-client (tests): validator.integration.test.ts uses ManualDateProvider; two timeout-dependent tests advance the clock past the deadline.

Fixes A-1265

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
PhilWindle enabled auto-merge (squash) June 24, 2026 13:09
@PhilWindle
PhilWindle merged commit e68eca2 into merge-train/spartan-v5 Jun 24, 2026
28 checks passed
@PhilWindle
PhilWindle deleted the spl/a-1265-deflake-validator branch June 24, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants