test(dash-spv): add multi-wallet integration tests#697
test(dash-spv): add multi-wallet integration tests#697xdustinface wants to merge 1 commit intov0.42-devfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds extensive multi-wallet SPV synchronization tests and a test helper: new multi-wallet test module with six end-to-end scenarios, a runtime-after-restart test, a helper to wait for wallet sync via WalletEvent subscriptions, and test harness wiring to include the new module; some basic test imports and a legacy two-wallet test were removed. ChangesMulti-Wallet SPV Sync Testing
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #697 +/- ##
=============================================
+ Coverage 70.58% 70.62% +0.03%
=============================================
Files 320 319 -1
Lines 68243 68211 -32
=============================================
+ Hits 48168 48171 +3
+ Misses 20075 20040 -35
|
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
bbf4de5 to
6514b12
Compare
6514b12 to
34c27d9
Compare
34c27d9 to
943eec3
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dash-spv/tests/dashd_sync/tests_multi_wallet.rs`:
- Around line 50-51: Add the #[ignore] attribute to network-dependent
integration tests so they don't run by default: place #[ignore] immediately
above each #[tokio::test] declaration in this file (including the test function
test_sync_two_wallets_same_client and the other four network-dependent test
cases mentioned) so they are excluded from regular runs and can be executed
explicitly with -- --ignored in the dedicated integration job.
In `@dash-spv/tests/dashd_sync/tests_restart.rs`:
- Around line 212-213: Add the #[ignore] attribute to the test function
declaration for test_runtime_add_after_restart so the test is not run by
default; specifically, place #[ignore] above the existing #[tokio::test] on the
test_runtime_add_after_restart function so it will only run when invoked with --
--ignored.
- Around line 247-263: Mark the network-dependent test (tests_restart.rs) with
#[ignore] and change the sync-event draining/watch logic to explicitly handle
broadcast lag: when draining client_handle.sync_event_receiver use try_recv()
but detect and handle RecvError::Lagged (don't silently ignore it), and in the
watch loop match recv() errors so that Err(RecvError::Lagged) is handled
separately (e.g., fail or increment a spurious counter) rather than treating all
recv errors the same as a timeout/break; reference the
SyncEvent::FiltersSyncComplete variant, client_handle.sync_event_receiver,
try_recv, recv, and RecvError::Lagged, and consider starting the receiver
observation before returning from wait_for_sync()/the function that spawns the
upstream rescan to avoid missing early events.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b4412e3d-697d-4715-918c-f636c88383a5
📒 Files selected for processing (5)
dash-spv/tests/dashd_sync/helpers.rsdash-spv/tests/dashd_sync/main.rsdash-spv/tests/dashd_sync/tests_basic.rsdash-spv/tests/dashd_sync/tests_multi_wallet.rsdash-spv/tests/dashd_sync/tests_restart.rs
Adds `tests_multi_wallet.rs` plus extensions to `tests_basic.rs` and `tests_restart.rs` covering per-wallet sync behavior: - Two wallets in one `WalletManager` sync independently. - Runtime wallet-add with `birth_height` before, at, and beyond tip, asserting existing wallets' `synced_height` and `last_processed_height` never regress. - Deep historical rescan triggered by a `birth_height = 0` runtime add. - A block funding two wallets is attributed correctly to each after both are added at runtime. - Runtime add against a `Syncing`-state `FiltersManager`. - Runtime-add rescan composed with a live tip advance. - Restart of a fully-synced client emits no rescan, then runtime-adding a second wallet only catches up the new wallet.
943eec3 to
348c570
Compare
Adds
tests_multi_wallet.rsplus extensions totests_basic.rsandtests_restart.rscovering per-wallet sync behavior:WalletManagersync independently.birth_heightbefore, at, and beyond tip, asserting existing wallets'synced_heightandlast_processed_heightnever regress.birth_height = 0runtime add.Syncing-stateFiltersManager.Based on:
birth_heightinManagedWalletInfoctors #692birth_height#693Summary by CodeRabbit