-
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
test: add p2p class sync fail cases tests #1943
base: main
Are you sure you want to change the base?
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 #1943 +/- ##
===========================================
- Coverage 40.10% 26.56% -13.55%
===========================================
Files 26 105 +79
Lines 1895 12634 +10739
Branches 1895 12634 +10739
===========================================
+ Hits 760 3356 +2596
- Misses 1100 8690 +7590
- Partials 35 588 +553 ☔ View full report in Codecov by Sentry. |
82219ff
to
e902b6e
Compare
96ea17d
to
b71daee
Compare
e902b6e
to
aeed8cc
Compare
b71daee
to
3f8115e
Compare
405ad78
to
ea85b72
Compare
3f8115e
to
f165321
Compare
ea85b72
to
b63c651
Compare
f165321
to
01a090f
Compare
b63c651
to
83532ab
Compare
01a090f
to
0aa1baf
Compare
f35d949
to
7329d44
Compare
0aa1baf
to
7506641
Compare
7506641
to
9439cf3
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 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @noamsp-starkware and @ShahakShama)
Suggestion:
negative flow
fail cases
crates/papyrus_p2p_sync/src/client/class_test.rs
line 316 at r2 (raw file):
panic!("P2P sync aborted with no failure."); } _ = parse_queries_future => {}
i recommend having a timeout clause to make sure this test ends
Code quote:
sync_result = p2p_sync.run() => {
sync_result.unwrap();
panic!("P2P sync aborted with no failure.");
}
_ = parse_queries_future => {}
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: all files reviewed, 6 unresolved discussions (waiting on @noamsp-starkware)
crates/papyrus_p2p_sync/src/client/class_test.rs
line 199 at r2 (raw file):
vec![2], vec![ Some(StateDiffChunk::DeclaredClass(DeclaredClass::default())),
These two will have the same hash and should also result in a conflict error. Please change one of them to a non default value
crates/papyrus_p2p_sync/src/client/class_test.rs
line 218 at r2 (raw file):
// was returned from parse_data_for_block. We currently dont have a way to check this. #[tokio::test] async fn class_not_in_state_diff() {
The class_hash and class_hash_in_state_diff in the test are the same. The name of this test should be "class_is_cairo0_and_cairo1_in_state_diff" or something like that. Plus, add a new test that does what the name of this test suggests
crates/papyrus_p2p_sync/src/client/class_test.rs
line 239 at r2 (raw file):
vec![2], vec![ Some(StateDiffChunk::DeclaredClass(DeclaredClass::default())),
This is an invalid state diff (see comment above). Change it to contain different hashes
crates/papyrus_p2p_sync/src/client/class_test.rs
line 239 at r2 (raw file):
vec![2], vec![ Some(StateDiffChunk::DeclaredClass(DeclaredClass::default())),
This test contains two errors (conflicting hashes and missing hashes).
I think what we can do is change it to have 3 hashes in the state diff and 2 classes sent, then we can test that it fails and doesn't wait for the 3rd class to be sent
No description provided.