Repository navigation
test(integration-tests): boot every test validator from a pre-warmed ledger - #269
Draft
gregorydemay wants to merge 1 commit into
Draft
gregorydemay wants to merge 1 commit into
gregorydemay wants to merge 1 commit into
Conversation
…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>
Contributor
There was a problem hiding this comment.
🟢 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.
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.
Starting a
solana-test-validatorfrom 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