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

Improved tests for 'hermes config auto' #3287

Merged
merged 5 commits into from
May 3, 2023

Conversation

ljoss17
Copy link
Contributor

@ljoss17 ljoss17 commented May 1, 2023

Closes: #3282

Description

This PR has two main improvements:

  1. Have a helper function to retry the query_healthy function a fixed number of times to avoid errors due to having too many concurrent queries.
  2. Improve the tests by using a fixed commit for the tests and running the tests in serial sequence to avoid errors caused by too many concurrent queries when checking that the endpoints are healthy.

Some additional comments have been added to clarify sensible parts of the code.


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@ljoss17 ljoss17 added I: CLI Internal: related to the relayer's CLI I: configuration Internal: related to Hermes configuration O: reliability Objective: cause to improve trustworthiness and consistent performing labels May 1, 2023
@ljoss17 ljoss17 requested review from romac and seanchen1991 May 1, 2023 10:09
Copy link
Contributor

@seanchen1991 seanchen1991 left a comment

Choose a reason for hiding this comment

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

Some minor nits, but otherwise looks good. Thanks @ljoss17!

use ibc_chain_registry::querier::{
GrpcHealthCheckQuerier, HermesConfigData, QueryContext, SimpleHermesRpcQuerier,
};
use ibc_relayer::config::{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking we don't want to have import statements nest more than one level deep; it makes it harder search and parse what's being imported. Could we split these out into multiple use statements?

@@ -245,16 +285,26 @@ pub async fn get_configs(
get_data_from_handles::<ChainConfig>(config_handles, "config_handle_join").await
}

/// Concurrent RPC and GRPC queries are likely to fail.
/// Since the the RPC and GRPC endpoints are queried to confirm they are healthy,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Since the the RPC and GRPC endpoints are queried to confirm they are healthy,
/// Since the RPC and GRPC endpoints are queried to confirm they are healthy,

@seanchen1991 seanchen1991 merged commit 10cf7db into master May 3, 2023
@seanchen1991 seanchen1991 deleted the luca_joss/improve-config-auto-cli branch May 3, 2023 13:52
pratikbin pushed a commit to pratikbin/hermes that referenced this pull request May 24, 2023
* Improved tests in 'chain_registry'

* Fix typo

* Improve 'query_healthy_retry' method

* Applied PR suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: CLI Internal: related to the relayer's CLI I: configuration Internal: related to Hermes configuration O: reliability Objective: cause to improve trustworthiness and consistent performing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix the hermes config auto tests
2 participants