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

debug: improve migration test #11655

Merged
merged 1 commit into from
Jun 24, 2024
Merged

debug: improve migration test #11655

merged 1 commit into from
Jun 24, 2024

Conversation

Longarithm
Copy link
Member

@Longarithm Longarithm commented Jun 24, 2024

Add unstaking and staking back to the db_migration test. Checking that #11569 would cause this version of test to fail.
Still not covers GC failure of EpochInfo, but that's a good improvement on its own.

Also, refactored to run nodes using start_cluster, as in other tests, instead of subprocess.call. This allows to override genesis and node configs.

@Longarithm Longarithm requested review from wacban and removed request for wacban June 24, 2024 13:28
@Longarithm Longarithm marked this pull request as ready for review June 24, 2024 13:29
@Longarithm Longarithm requested a review from a team as a code owner June 24, 2024 13:29
@Longarithm Longarithm requested review from akhi3030, wacban and jancionear and removed request for akhi3030 June 24, 2024 13:29
Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

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

LGTM


# Config to track all shards.
node_config = {
"tracked_shards": list(range(NUM_SHARDS)),
Copy link
Contributor

Choose a reason for hiding this comment

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

lol, this never gets old :)

Copy link
Member Author

Choose a reason for hiding this comment

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

but it makes sense there? if node stops being a validator, we specifically ask it to continue tracking all shards.

Copy link
Contributor

Choose a reason for hiding this comment

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

my point is that any non-empty value for tracked_shards has exactly the same effect

Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen a few different conventions such as setting it to [0] or [666] or [0..num_shard] like you've done, they all mean the same

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, okay. I didn't know that all these conventions still work

@@ -63,7 +63,7 @@ class Executables(typing.NamedTuple):
def node_config(self) -> typing.Dict[str, typing.Any]:
return {
'local': True,
'neard_root': self.root,
'near_root': self.root,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you confirm that no other codepath relies on this? I guess just schedule a full nayduck run and see that it doesn't break any tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

there are literally 0 occurrences of neard_root :) will do, anyway

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.66%. Comparing base (9f5b03e) to head (0772761).
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11655      +/-   ##
==========================================
+ Coverage   71.59%   71.66%   +0.07%     
==========================================
  Files         787      787              
  Lines      160736   161063     +327     
  Branches   160736   161063     +327     
==========================================
+ Hits       115072   115426     +354     
+ Misses      40631    40591      -40     
- Partials     5033     5046      +13     
Flag Coverage Δ
backward-compatibility 0.23% <ø> (-0.01%) ⬇️
db-migration 0.23% <ø> (-0.01%) ⬇️
genesis-check 1.36% <ø> (-0.01%) ⬇️
integration-tests 37.82% <ø> (+0.08%) ⬆️
linux 69.05% <ø> (+0.05%) ⬆️
linux-nightly 71.16% <ø> (+0.09%) ⬆️
macos 52.62% <ø> (+1.27%) ⬆️
pytests 1.59% <ø> (-0.01%) ⬇️
sanity-checks 1.39% <ø> (-0.01%) ⬇️
unittests 66.23% <ø> (+0.06%) ⬆️
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.

@Longarithm Longarithm added this pull request to the merge queue Jun 24, 2024
Merged via the queue into near:master with commit 4b92c88 Jun 24, 2024
30 checks passed
@Longarithm Longarithm deleted the db-m-test branch June 24, 2024 14:13
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