-
Notifications
You must be signed in to change notification settings - Fork 228
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
rpc: add Client::wait_until_healthy
method
#855
rpc: add Client::wait_until_healthy
method
#855
Conversation
d107113
to
c86f077
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great idea! Have you tested it locally on your side?
Adds a method which repeatedly polls the `/health` endpoint until it returns a successful response or a specified timeout elapses. This is useful when writing tests that need to wait for a node to boot up (e.g. inside of a docker container).
c86f077
to
2898474
Compare
I updated the PR linked in the description to use code that is now nearly identical to this and it's working as expected locally: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. I'd like to include this in the v0.19.0 release. Could you please add this to the CHANGELOG
under the IMPROVEMENTS
section?
Actually don't worry about it - I'll add something tomorrow when I finalize the release. It'll be easier that way so we don't have merge conflicts in the changelog. |
Signed-off-by: Thane Thomson <[email protected]>
* Update changelog for v0.19.0 release Signed-off-by: Thane Thomson <[email protected]> * Bump versions to v0.19.0 Signed-off-by: Thane Thomson <[email protected]> * Add minor documentation for tendermint-light-client-js crate Signed-off-by: Thane Thomson <[email protected]> * Add abci and light-client-js crates to release script Signed-off-by: Thane Thomson <[email protected]> * Add cargo metadata for abci and light-client-js Signed-off-by: Thane Thomson <[email protected]> * Fix keywords in abci and light-client-js crates Signed-off-by: Thane Thomson <[email protected]> * rpc: add `Client::wait_until_healthy` method (#855) Adds a method which repeatedly polls the `/health` endpoint until it returns a successful response or a specified timeout elapses. This is useful when writing tests that need to wait for a node to boot up (e.g. inside of a docker container). * Temporarily remove RPC query parsing (#858) Signed-off-by: Thane Thomson <[email protected]> * Add CHANGELOG entry for #855 Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: Tony Arcieri (iqlusion) <[email protected]>
I noticed one small problem with this trying to use it. After updating to Perhaps it should look for certain kinds of errors, i.e. ones relating to the remote node being down, and bubble all others up. Alternatively e.g. Otherwise I switched my code to use it and it's working great! |
Yes, I think I've just found a small bug in the |
Adds a method which repeatedly polls the
/health
endpoint until it returns a successful response or a specified timeout elapses.This is useful when writing tests that need to wait for a node to boot up (e.g. inside of a docker container), e.g.:
https://github.com/cosmos/cosmos-rust/pull/71/files#diff-0e31f23fc223d1d543169a682e0f1093c1cc53c6a312febce7d5d1854919fafaR84-R96