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

test: state sync cleanup #11980

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

test: state sync cleanup #11980

wants to merge 2 commits into from

Conversation

staffik
Copy link
Contributor

@staffik staffik commented Aug 21, 2024

Issue: #11883
Add two tests:

  • gc_after_node_offline - make a node offline for more than 1 epoch and bring it back, eventually old block data should be gc-ed.
  • gc_after_shard_switch - change tracked shard for a node, eventually old data (including chunks for the shard that is no longer tracked) should be gc-ed.

Both tests currently fail.

Run with (for gc_after_node_offline):

cargo build -pneard --features test_features,rosetta_rpc && cargo build -pgenesis-populate -prestaked -pnear-test-contracts && RUST_BACKTRACE=full python3 pytest/tests/sanity/gc_after_node_offline.py

@staffik staffik requested a review from a team as a code owner August 21, 2024 11:47
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to duplicate sanity/gc_after_sync1.py except for the single shard tracking part. Can you adapt that test to have 2 cases. one with all shards tracking and one with single shard tracking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about renaming the new test to gc_after_sync_single_shard_tracking ? Having two test cases in single file did not work for me well, and the old test takes 5x longer to execute. Also, there are more differences, e.g. in the new test we stop validator node.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I think gc_after_sync1 is better and we do not need gc_after_node_offline.
I would remove this one, gc_after_shard_switch suffices.
I see why gc_after_sync1 fails, working on that.

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.50%. Comparing base (6ab26a0) to head (365c1df).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11980      +/-   ##
==========================================
- Coverage   71.57%   71.50%   -0.07%     
==========================================
  Files         810      810              
  Lines      163803   163949     +146     
  Branches   163803   163949     +146     
==========================================
- Hits       117237   117229       -8     
- Misses      41486    41640     +154     
  Partials     5080     5080              
Flag Coverage Δ
backward-compatibility 0.23% <ø> (-0.01%) ⬇️
db-migration 0.23% <ø> (-0.01%) ⬇️
genesis-check 1.33% <ø> (-0.01%) ⬇️
integration-tests 38.42% <ø> (-0.03%) ⬇️
linux 71.28% <ø> (-0.04%) ⬇️
linux-nightly 71.06% <ø> (-0.09%) ⬇️
macos 54.32% <ø> (-0.07%) ⬇️
pytests 1.60% <ø> (-0.01%) ⬇️
sanity-checks 1.40% <ø> (-0.01%) ⬇️
unittests 65.59% <ø> (-0.09%) ⬇️
upgradability 0.28% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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.

2 participants