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

Add --retry and --retry-interval option to retry request until asserts and captures are ok #871

Merged
merged 3 commits into from
Oct 17, 2022

Conversation

jcamiel
Copy link
Collaborator

@jcamiel jcamiel commented Oct 2, 2022

Add --retry and --retry-interval option to retry request until asserts and captures are ok.

Closes #525.

@jcamiel jcamiel changed the title Feature/option retry Add --retry and --retry-interval option to retry request until asserts and captures are ok Oct 2, 2022
@jcamiel jcamiel force-pushed the feature/option-retry branch from 3adc307 to 8003375 Compare October 2, 2022 18:07
@jcamiel jcamiel force-pushed the feature/option-retry branch from 8003375 to 3d4c312 Compare October 3, 2022 04:07
@Jiehong
Copy link

Jiehong commented Oct 5, 2022

Maybe instead of retry being a boolean, a max_retries set to 0 by default would allow to both handle activating retrying, and setting a limit to the number of retries.

@jcamiel WDYT?

@jcamiel
Copy link
Collaborator Author

jcamiel commented Oct 5, 2022

I don't know if it's better to have a a maximum retry count, a maximum retry duration, etc... For now I'm going to go with
--retry flag + --retry-max-count COUNT, --retry-max-duration SECONDS and --retry-interval MILLISECONDS(I like the options to have a common prefix like --report-html and report-unit)... But nothing is set in stone!

@Jiehong
Copy link

Jiehong commented Oct 5, 2022

To me --retry-max-duration feels like is sort of in conflict with --retry-max-count and --retry-interval.

--retry-max-duration also feels a bit variable. If you service is slow, it might mean to retry a handle of times, but it might mean thousands of times instead.

My 2 usecases would be:

Unreliable endpoint:

  1. this service is a bit flaky, retry it
  2. wait 1 second before retrying, then 2, then 4, then 8 seconds (backing off);
  3. don't retry more than 3 times, because it's quite unlikely

Second usecase is:

  1. I'm polling this api, because a status is changing, and I want to wait until it happens
  2. wait a constant time of 500ms between retries
  3. stop after 10 retries, if condition not met.

I also like the --retry- prefix to group all those options, though!

@jcamiel
Copy link
Collaborator Author

jcamiel commented Oct 5, 2022

@Jiehong Thanks for the usecase, I will take these into accounts once the PR is more advance (I need to do prior work on master to make it easier to develop)

@jcamiel jcamiel force-pushed the feature/option-retry branch 2 times, most recently from 1640111 to d01add9 Compare October 15, 2022 20:40
@jcamiel jcamiel marked this pull request as ready for review October 15, 2022 21:01
@jcamiel jcamiel force-pushed the feature/option-retry branch 2 times, most recently from bd1f765 to c78d09a Compare October 16, 2022 10:15
@jcamiel jcamiel force-pushed the feature/option-retry branch from c78d09a to 43e6f70 Compare October 17, 2022 06:50
@jcamiel jcamiel assigned jcamiel and fabricereix and unassigned jcamiel Oct 17, 2022
@fabricereix
Copy link
Collaborator

/accept

@github-actions
Copy link

🕗 /accept is running, please wait for completion.

@github-actions
Copy link

✅ Pull request accepted and closed by fabricereix with fast forward merge..

# List of commits merged from Orange-OpenSource/hurl/feature/option-retry branch into Orange-OpenSource/hurl/master branch:

  • 43e6f70 Add comment.
  • 104360a Update integration tests.
  • a58d4f2 Add --retry and --retry-interval options.

@github-actions github-actions bot merged commit 43e6f70 into master Oct 17, 2022
@github-actions github-actions bot deleted the feature/option-retry branch October 17, 2022 11:58
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.

Retry / Poll behaviour for asynchronous systems
3 participants