tests(nano): fix reset counters after failed calls#1622
Merged
Conversation
16817da to
96f78b6
Compare
|
| Branch | tests/nano/reset-counter |
| Testbed | ubuntu-22.04 |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result minutes (m) (Result Δ%) | Lower Boundary minutes (m) (Limit %) | Upper Boundary minutes (m) (Limit %) |
|---|---|---|---|---|
| sync-v2 (up to 20000 blocks) | 📈 view plot 🚷 view threshold | 1.60 m(-6.44%)Baseline: 1.71 m | 1.54 m (96.19%) | 2.05 m (77.97%) |
msbrogli
approved these changes
Mar 17, 2026
jansegre
approved these changes
Mar 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1622 +/- ##
==========================================
- Coverage 85.40% 85.31% -0.09%
==========================================
Files 462 462
Lines 31166 31166
Branches 4730 4730
==========================================
- Hits 26617 26590 -27
- Misses 3641 3659 +18
- Partials 908 917 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
96f78b6 to
03084a1
Compare
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.
Motivation
There's a bug in the
Runnerthat only affects tests, this PR fixes it.Currently, the reset of token counters in the
Runnerhappens at the end of the_unsafe_call_public_methodmethod. This means the reset doesn't run when the method fails, which causes subsequent calls to hit an assertion. By moving said reset to the_reset_all_changesmethod instead, it's wrapped in atry-finallyblock, making sure it runs even after failures.NOTE: This only affects tests, not mainnet/testnet, because runners are individual per call/tx, not reused like in tests. So the final invalid state is simply discarded. Therefore, we can merge and release this change without affecting the consensus.
Acceptance Criteria
Runner._reset_all_change_trackers()toRunner._reset_all_changes()._unsafe_call_public_methodto_reset_all_changes.Checklist
master, confirm this code is production-ready and can be included in future releases as soon as it gets merged