hydra
hydra copied to clipboard
Tune snapshot generation in TxTrace tests
trafficstars
Follow-up of #1057
Why
When implementing incremental decommits in #1344, we significantly increased the complexity of snapshots used in the TxTrace tests and switched from a "ahead of time" to a "just in time" generation of snapshots to decrement, close and contest a head with.
This resulted in complicated generation and lots of filtering through preconditions, making the tests less efficient and hard to maintain.
Also, the generated traces are not covering all "interesting" situations within reasonable max successes and we needed to disable checkCoverage on prop_traces.
What
- Have less actions discarded than actually tested: currently 1.6k discards on 100 runs with only 790 valid actions tested.
- Ensure interesting cases are generated with lower sizes in
prop_traces, re-enablecheckCoverageand use the same number of tests in theprop_runActions - Reduce "number of moving pieces" and improve maintainability where possible
How
- Generate snapshots separate from using them, i.e.
Decrement,CloseandContestjust pick from an available list of snapshots in the model - Try to get rid of most predicates that are in both,
preconditionandvalidFailingAction-> this reduces discards