-
Notifications
You must be signed in to change notification settings - Fork 26
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
refactor: add wait_for_marker to p2p_sync:client test_utils #2147
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2147 +/- ##
===========================================
- Coverage 40.10% 18.49% -21.61%
===========================================
Files 26 106 +80
Lines 1895 12638 +10743
Branches 1895 12638 +10743
===========================================
+ Hits 760 2338 +1578
- Misses 1100 9859 +8759
- Partials 35 441 +406 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
e44802d
to
62c45eb
Compare
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.
Reviewed all commit messages.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @noamsp-starkware)
crates/papyrus_p2p_sync/src/client/state_diff_test.rs
line 153 at r1 (raw file):
let txn = storage_reader.begin_ro_txn().unwrap(); let state_diff = txn.get_state_diff(block_number).unwrap().unwrap(); let expected_state_diff = match state_diff_chunk {
Unrelated to the PR: I think there's a mistake here in the test and we treat each state diff chunk as a separate state diff. Let's fix that
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.
Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @noamsp-starkware)
crates/papyrus_p2p_sync/src/client/test_utils.rs
line 143 at r1 (raw file):
sleep_duration: Duration, timeout: Duration, ) -> Result<(), StorageError> {
We're in a test. If a storage error happened you can panic
crates/papyrus_p2p_sync/src/client/test_utils.rs
line 150 at r1 (raw file):
let txn = storage_reader.begin_ro_txn().unwrap(); let storage_marker = match marker_kind {
Consider using the marker table directly instead:
let markers_table = self.open_table(&self.tables.markers)?; |
crates/papyrus_p2p_sync/src/client/test_utils.rs
line 157 at r1 (raw file):
}; match storage_marker {
Run the match on cmp(storage_marker, expected_marker)
If you accept my suggestion below, change this into an if instead
crates/papyrus_p2p_sync/src/client/test_utils.rs
line 159 at r1 (raw file):
match storage_marker { marker if marker > expected_marker => { return Err(StorageError::MarkerMismatch {
IMO this is not an error and equivalent to the == case
62c45eb
to
f1b4ed5
Compare
f1b4ed5
to
612c480
Compare
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.
Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @ShahakShama)
crates/papyrus_p2p_sync/src/client/test_utils.rs
line 143 at r1 (raw file):
Previously, ShahakShama wrote…
We're in a test. If a storage error happened you can panic
Done.
crates/papyrus_p2p_sync/src/client/test_utils.rs
line 157 at r1 (raw file):
Previously, ShahakShama wrote…
Run the match on cmp(storage_marker, expected_marker)
If you accept my suggestion below, change this into an if instead
Done.
crates/papyrus_p2p_sync/src/client/test_utils.rs
line 159 at r1 (raw file):
Previously, ShahakShama wrote…
IMO this is not an error and equivalent to the == case
Done.
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.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noamsp-starkware)
No description provided.