Summary
The current rpc_regression_tests function runs all snapshot tests as a single async test. This approach has several drawbacks:
- Limited concurrency: Tests run inside a single function, so cargo
nextest can't parallelize them. This increases the risk of hitting timeouts.
- Unstructured input:
test_snapshots.txt is just a list of filenames, no descriptions or metadata. It's unclear what each snapshot is testing.
Proposal:
Replace test_snapshots.txt with a structured JSON file:
[
{
"name": "snapshot_name.rpcsnap.json.zst",
"description": "What this snapshot is testing"
}
]
Use a macro to generate a separate #[test] for each entry in the file.
Maybe use the description when naming tests for easier debugging.
Completion Criteria
All tests still pass, with improved overall execution speed.
Additional Links & Resources
https://github.com/ChainSafe/forest/blob/main/src/tool/subcommands/api_cmd/test_snapshot.rs
Summary
The current
rpc_regression_testsfunction runs all snapshot tests as a single async test. This approach has several drawbacks:nextestcan't parallelize them. This increases the risk of hitting timeouts.test_snapshots.txtis just a list of filenames, no descriptions or metadata. It's unclear what each snapshot is testing.Proposal:
Replace
test_snapshots.txtwith a structured JSON file:[ { "name": "snapshot_name.rpcsnap.json.zst", "description": "What this snapshot is testing" } ]Use a macro to generate a separate
#[test]for each entry in the file.Maybe use the description when naming tests for easier debugging.
Completion Criteria
All tests still pass, with improved overall execution speed.
Additional Links & Resources
https://github.com/ChainSafe/forest/blob/main/src/tool/subcommands/api_cmd/test_snapshot.rs