-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactoring: Speed up flipped block test #12840
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a problem with the setup change although I wouldn't claim I'm 100% certain. However, I think we can merge.
|
||
let mid_height = 3; | ||
for h in 1..=mid_height { | ||
let mid_height = last_block_height + 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get last_block_height
from last_block.height()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is possible indeed
I had to fix check_corrupt_block()
to do properly process the correct block, though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a biggie, only if it is convenient and straightforward
7098153
to
dd7c5cc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12840 +/- ##
==========================================
- Coverage 70.41% 70.39% -0.02%
==========================================
Files 848 851 +3
Lines 174849 174187 -662
Branches 174849 174187 -662
==========================================
- Hits 123117 122623 -494
+ Misses 46485 46320 -165
+ Partials 5247 5244 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This PR makes the test
ultra_slow_test_check_process_flipped_block_fails
more efficient by re-using the same test loop environment, instead of initializing a newTestEnv
at every iteration.Locally the test runs 40% faster.