-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix(test): Wait for zebrad and lightwalletd to reach the tip in tests, to improve test coverage #5164
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5164 +/- ##
==========================================
+ Coverage 79.09% 79.17% +0.07%
==========================================
Files 308 308
Lines 39560 39560
==========================================
+ Hits 31291 31320 +29
+ Misses 8269 8240 -29 |
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.
This is pretty much what we want.
I just want to add a few more checks to some tests, so they run for longer and cover more blocks and code.
@Mergifyio update |
✅ Branch has been successfully updated |
I combined the test APIs for the lightwalletd sync and gRPC tests. But I still need to fix some test failures. |
This comment was marked as resolved.
This comment was marked as resolved.
@Mergifyio update |
✅ Branch has been successfully updated |
This comment was marked as resolved.
This comment was marked as resolved.
Alfredo is going to review this PR, but I can't set him as a reviewer, because he opened it. |
This comment was marked as resolved.
This comment was marked as resolved.
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.
This looks really good to me. I can't approve as i am the original author but it seems to be merge ready.
I'm reviewing this PR now. |
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.
Arya and Alfredo have already reviewed this PR.
@Mergifyio update |
✅ Branch has been successfully updated |
|
@Mergifyio refresh |
✅ Pull request refreshed |
…, to improve test coverage (#5164) * Add RPC timing to zcash-rpc-diff * Use transaction hash index for verbose block requests, rather than block data * check if we are at tip for lightwallet wallet tests * move function * Apply suggestions from code review Co-authored-by: teor <[email protected]> * Combine the lightwalletd sync and gRPC test APIs * Rewrite the gRPC and full sync tests for the new APIs * Make zebra_rpc_address optional because only some tests need it * Check for the zebrad RPC port to open in the right place * Do the quick lightwalletd integration tests first in the sequential test function * Ignore the lightwalletd cached state env var in tests that don't want it * Don't replace the state path in RPC tests * Enable IO (and timers) on the tip check tokio runtime * Stop waiting for sync if either waiter thread errors or panics * Try to speed up slow lightwalletd full syncs * Don't wait for the tip in send transaction tests, and try to speed up full lightwalletd syncs * Remove redundant is_lightwalletd_finished store Co-authored-by: Arya <[email protected]> * Fix unused variable error * Actually create the lightwalletd cached state * Fix lwd cache check logic Co-authored-by: teor <[email protected]> Co-authored-by: Arya <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Previous behavior: In PR #5164, we made lightwalletd sync all the way to the tip in its full sync test. This increases that test's time from 1 hour to 4 hours, which makes the CI we run on each PR change increase from 3 hours to 6 hours. Expected behavior: Run the lightwalletd full sync just on `main` or if a state disk for the actual version is not found. Solution: Add the `github.event_name == 'push' && github.ref_name == 'main'` condition to the `lightwalletd-full-sync` test. Fixes #5316
…5393) * ci(sync): only run the `lightwalletd` full sync on the `main` branch Previous behavior: In PR #5164, we made lightwalletd sync all the way to the tip in its full sync test. This increases that test's time from 1 hour to 4 hours, which makes the CI we run on each PR change increase from 3 hours to 6 hours. Expected behavior: Run the lightwalletd full sync just on `main` or if a state disk for the actual version is not found. Solution: Add the `github.event_name == 'push' && github.ref_name == 'main'` condition to the `lightwalletd-full-sync` test. Fixes #5316 * Allow lwd full syncs to be triggered manually (#5400) * Limit checkpoint and lwd full sync concurrency * Add a patch job for lightwalletd-full-sync Co-authored-by: teor <[email protected]>
Motivation
We need to make sure lightwalletd and zebrad is at the tip for several tests. Fix #4894 if merged.
Depends-On: #5307
Solution
Add a new function and move common code to check if we are at the tip. Call it from tests. We are calling this function from all tests that call
lightwalletd_integration_test
and fromwallet_grpc_test
andsend_transaction_test
.Also, the
lightwalletd_test_suite
now runswallet_grpc_test
beforesend_transaction_test
so we know cache is up to date when running the tests using the suite.Functional changes:
zebrad
andlightwalletd
across all 8 RPC integration tests,this makes all these tests check a bunch of things the same way
Refactors:
Review
This PR is ready for review.
Reviewer Checklist