-
Notifications
You must be signed in to change notification settings - Fork 859
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
test(sync): stage test suite #204
Conversation
@onbjerg one more thing i've noticed is that some bodies tests are flaky. |
Codecov Report
@@ Coverage Diff @@
## main #204 +/- ##
==========================================
- Coverage 67.74% 66.86% -0.88%
==========================================
Files 213 217 +4
Lines 18142 18205 +63
==========================================
- Hits 12290 12173 -117
- Misses 5852 6032 +180
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This is likely because the blocks are randomly generated and empty blocks are skipped, i.e. if a block has no ommers and no transactions we don't request it from the network. So the amount of blocks processed by the stage might deviate a bit |
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.
A few questions, but also unsure how to validate if the body tests do the same things as before/cover the same edge cases. Any ideas on how we could do that?
@onbjerg not sure other than the manual inspection. i removed the tests that are covered by the |
@rkrasiuk Seems like the same lines are covered in both stages, so should be good |
@gakonst yeah, for headers you need to update chain tip before await the value |
Create a common test suite for stages.
The
stage_test_suite
macro contains the default stage tests impl:Stage::execute
with empty dbStage::execute
with inputstage_progress
equal toprev_stage_progress
Stage::execute
with normal input and validate the database entriesStage::unwind
with empty dbStage::execute
and callStage::unwind
to the originalstage_progress
. validate the database state after each call