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/e2e/staking to system tests #21874

Closed
Tracked by #20800
JulianToledano opened this issue Sep 24, 2024 · 1 comment · Fixed by #21882
Closed
Tracked by #20800

test/e2e/staking to system tests #21874

JulianToledano opened this issue Sep 24, 2024 · 1 comment · Fixed by #21882
Assignees
Labels

Comments

@JulianToledano
Copy link
Contributor

  • Find an e2e test from tests/e2e that looks like a system test.
  • Rewrite it as a system test and verify it runs with v1 and v2 (CI does that)
  • Delete the old e2e test.
@JulianToledano
Copy link
Contributor Author

There is already a staking system test that is quite similar to the e2e test. However, the e2e test also checks for validator_updates in block-results. I've been trying to replicate that functionality without success, as I always get null validator_updates for the upcoming blocks. It turns out that the same issue is occurring in the e2e test, but we are not checking for the error.

// Loop until we find a block result with the correct validator updates.
// By experience, it happens around 2 blocks after `delHeight`.
_ = s.network.RetryForBlocks(func() error {
latestHeight, err := s.network.LatestHeight()
require.NoError(err)
res, err := rpcClient.BlockResults(context.Background(), &latestHeight)
if err != nil {
return err
}
if len(res.ValidatorUpdates) == 0 {
return errors.New("validator update not found yet")
}
valUpdate := res.ValidatorUpdates[0]
require.Equal(
valUpdate.PubKeyBytes,
val.GetPubKey().Bytes(),
)
return nil
}, 10)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

1 participant