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

fix(testloop): set epoch length in testloop #12664

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

Conversation

staffik
Copy link
Contributor

@staffik staffik commented Dec 23, 2024

Some resharding tests failed if an RPC node was used to submit transactions.

It worked without RPC because client0 was used by default, and it turned out this client was a chunk validator for the child shard after resharding.
It did not work with RPC (or any client other than client0) because a transaction near epoch boundary was not forwarded to client0. It was not forwarded because config.epoch_length was not properly set in testloop.
It has default value 10, while resharding tests use 6. That caused get_next_epoch_id_if_at_boundary to return different result that expected. In consequence, transaction was not sent to client0, which was a chunk producer for next epoch.

@staffik staffik requested review from wacban and Trisfald December 23, 2024 14:10
@staffik staffik requested a review from a team as a code owner December 23, 2024 14:10
@@ -503,6 +503,7 @@ impl TestLoopBuilder {
let genesis = self.genesis.as_ref().unwrap();
let epoch_config_store = self.epoch_config_store.as_ref().unwrap();
let mut client_config = ClientConfig::test(true, 600, 2000, 4, is_archival, true, false);
client_config.epoch_length = genesis.config.epoch_length;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

actual fix

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.48%. Comparing base (33afc1d) to head (de5aaa7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12664      +/-   ##
==========================================
- Coverage   70.50%   70.48%   -0.02%     
==========================================
  Files         845      845              
  Lines      172257   172258       +1     
  Branches   172257   172258       +1     
==========================================
- Hits       121442   121420      -22     
- Misses      45717    45738      +21     
- Partials     5098     5100       +2     
Flag Coverage Δ
backward-compatibility 0.16% <ø> (ø)
db-migration 0.16% <ø> (ø)
genesis-check 1.36% <ø> (ø)
linux 69.35% <100.00%> (-0.02%) ⬇️
linux-nightly 70.08% <100.00%> (-0.02%) ⬇️
pytests 1.66% <ø> (ø)
sanity-checks 1.47% <ø> (ø)
unittests 70.31% <100.00%> (-0.02%) ⬇️
upgradability 0.20% <ø> (ø)

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.

Copy link
Contributor

@Trisfald Trisfald left a comment

Choose a reason for hiding this comment

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

amazing 🎄

@@ -1146,8 +1144,7 @@ fn test_resharding_v3_yield_resume() {
vec![account_in_left_child, account_in_right_child],
ReceiptKind::PromiseYield,
))
// TODO(resharding): test should work without changes to num_rpcs and track_all_shards
.num_rpcs(0)
// TODO(resharding): test should work without changes to track_all_shards
.track_all_shards(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

We still have the issue of track_all_shards must be true, right?

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