Skip to content

tests(nano): fix reset counters after failed calls#1622

Merged
glevco merged 1 commit intomasterfrom
tests/nano/reset-counter
Mar 18, 2026
Merged

tests(nano): fix reset counters after failed calls#1622
glevco merged 1 commit intomasterfrom
tests/nano/reset-counter

Conversation

@glevco
Copy link
Copy Markdown
Contributor

@glevco glevco commented Mar 17, 2026

Motivation

There's a bug in the Runner that only affects tests, this PR fixes it.

Currently, the reset of token counters in the Runner happens at the end of the _unsafe_call_public_method method. 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_changes method instead, it's wrapped in a try-finally block, 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

  • Rename Runner._reset_all_change_trackers() to Runner._reset_all_changes().
  • Move the reset of token counters from _unsafe_call_public_method to _reset_all_changes.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Mar 17, 2026
@glevco glevco force-pushed the tests/nano/reset-counter branch from 16817da to 96f78b6 Compare March 17, 2026 19:56
@glevco glevco moved this from Todo to In Progress (Done) in Hathor Network Mar 17, 2026
@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Mar 17, 2026
@glevco glevco moved this from In Review (WIP) to In Progress (Done) in Hathor Network Mar 17, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

🐰 Bencher Report

Branchtests/nano/reset-counter
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark 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%)
🐰 View full continuous benchmarking report in Bencher

@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Mar 17, 2026
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Mar 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.31%. Comparing base (199c42b) to head (03084a1).
⚠️ Report is 1 commits behind head on master.

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     
Flag Coverage Δ
test-lib 85.31% <100.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glevco glevco force-pushed the tests/nano/reset-counter branch from 96f78b6 to 03084a1 Compare March 17, 2026 22:25
@glevco glevco merged commit 3d034fb into master Mar 18, 2026
31 of 33 checks passed
@glevco glevco deleted the tests/nano/reset-counter branch March 18, 2026 00:26
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Mar 18, 2026
@jansegre jansegre mentioned this pull request Mar 19, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting to be deployed

Development

Successfully merging this pull request may close these issues.

3 participants