Skip to content

test(integration-tests): boot every test validator from a pre-warmed ledger - #269

Draft
gregorydemay wants to merge 1 commit into
mainfrom
test/prewarmed-validator-ledger
Draft

gregorydemay wants to merge 1 commit into
mainfrom
test/prewarmed-validator-ledger

Conversation

@gregorydemay

Copy link
Copy Markdown
Contributor

Starting a solana-test-validator from scratch means its ledger charges no transaction fee for the block the minter builds its first sweep on. Every test therefore waited for the regular fee to appear before it could do anything, and that wait was budgeted at two minutes. On a loaded CI runner, with five validators next to PocketIC and the SOL RPC canister, the budget was occasionally exceeded and the test failed with nothing to go on.

Instead of paying that wait per test, the test binary now warms up one ledger, keeps it in memory, and starts every test validator on its own copy of it. A validator then serves the regular fee as soon as it accepts requests. Each test keeps its own ledger, its own ports and its own temporary directory, so the tests still run in parallel and clean up after themselves.

Measured locally over the whole validator test suite, the per-validator wait drops from 6.6s to 1.6s, and the one-off warm-up costs 3.8s. The suite itself is dominated by its slowest test, so it only goes from ~74s to ~72s; the point is that the two-minute budget is no longer on the critical path of five tests.

The readiness check is kept, in a much shorter form, because a validator still needs a moment to start serving. It is no longer waiting for the fee to change, so 30s is plenty. Two related fixes come along: the check now looks at the commitment the minter actually builds sweeps on rather than a stricter one, and the validator output is captured so that a startup failure is reported instead of being discarded.

🤖 Generated with Claude Code

…ledger

A brand-new solana-test-validator ledger charges no transaction fee for the
block the minter builds its first sweep on, so every test had to wait for the
regular fee to appear before it could do anything. That wait was budgeted at
two minutes, which a loaded CI runner running five validators occasionally
exceeded, failing the test with no diagnostic at all.

The test binary now produces such a warmed-up ledger once, keeps it in memory,
and starts every test validator on its own copy of it, so a validator serves
the regular fee as soon as it is up. Each validator still gets its own ledger,
its own ports and its own temporary directory, and the readiness check is kept
as a much shorter probe that the validator is serving. The probe now uses the
confirmed commitment the minter actually builds sweeps on, and the validator
output is captured so that a startup failure is reported instead of being
discarded.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The validator lifecycle and ledger isolation changes are consistent and preserve parallel test cleanup.

0 open findings

What changed in this PR

Pre-warms a shared Solana ledger to reduce integration-test startup latency and CI flakiness.

Changes:

  • Starts each validator from an isolated warm-ledger copy.
  • Aligns readiness checks with confirmed commitment.
  • Captures validator output for startup diagnostics.
File Description
integration_tests/​src/​validator.rs Implements ledger warm-up, cloning, readiness polling, shutdown, and output capture.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants