Skip to content
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

Add more UT for error cases simulated with sisl::flip #243

Merged
merged 2 commits into from
Dec 25, 2024

Conversation

koujl
Copy link
Contributor

@koujl koujl commented Dec 17, 2024

Enhance existing class-level UT:

  • Add test for handling corrupted message
  • Add verification for chunk release of sealed shards

Introduce sisl::flip and simulate error cases in dynamic test

@koujl koujl marked this pull request as ready for review December 17, 2024 09:27
@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 27.27273% with 32 lines in your changes missing coverage. Please review.

Project coverage is 64.60%. Comparing base (55efbde) to head (3d84fb9).
Report is 3 commits behind head on baseline_resync.

Files with missing lines Patch % Lines
...lib/homestore_backend/snapshot_receive_handler.cpp 0.00% 14 Missing and 3 partials ⚠️
src/lib/homestore_backend/heap_chunk_selector.cpp 57.14% 4 Missing and 2 partials ⚠️
src/lib/homestore_backend/pg_blob_iterator.cpp 28.57% 2 Missing and 3 partials ⚠️
...ib/homestore_backend/replication_state_machine.cpp 33.33% 3 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           baseline_resync     #243      +/-   ##
===================================================
- Coverage            65.52%   64.60%   -0.92%     
===================================================
  Files                   33       33              
  Lines                 2271     2407     +136     
  Branches               254      275      +21     
===================================================
+ Hits                  1488     1555      +67     
- Misses                 659      709      +50     
- Partials               124      143      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@koujl koujl force-pushed the baseline_resync branch 4 times, most recently from ba51e6b to 025d864 Compare December 20, 2024 09:01
LOGINFO("TESTING: applying blobs for shard {} batch {}", shard.id, j);
std::vector< ::flatbuffers::Offset< ResyncBlobData > > blob_entries;
bool is_corrupted_batch = j < num_batches_per_shard &&
corrupt_dis(gen) <= unexpected_corrupted_batch_percentage; // Don't test on last batch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't test on last batch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, for simplicity I'm not simulating resending the corrupted batch here. Instead, I'm just dropping and ignoring it - and dropping the last batch will cause issues to the following process.

I've added more comments here to explain the reason in the latest force-push.

Copy link
Collaborator

@JacksonYao287 JacksonYao287 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@koujl koujl requested a review from yuwmao December 25, 2024 01:41
Copy link
Contributor

@yuwmao yuwmao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@koujl koujl merged commit b117d2d into eBay:baseline_resync Dec 25, 2024
24 checks passed
koujl added a commit that referenced this pull request Jan 6, 2025
* Enhance SnapshotReceiveHandler UTs
* Add test and flip for snapshot resync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants