Repository navigation
feat: retry only an unmet condition with retry.on: until - #14
Merged
Merged
Conversation
A poll that calls a system which must not see a repeated request can now stop at the first failed attempt instead of retrying it. The default keeps retrying failed attempts.
Member
Author
|
Review of the diff, with dispositions:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A step with
retryanduntilretries two kinds of attempt: one that failed (non-zero exit, unmetexpect) and one that succeeded withuntilstill false. For a poll against a system that must not see a repeated request after an error, the first kind is unsafe: a transient error turns into a second call.retry.on: untilopts a step into retrying only the second kind. The first failed attempt ends the step, with that attempt's own headline (its stderr or exit code), and no further attempts.ondefaults toany, so existing flows behave as before.on: untilwithoutuntilis a validation error.untilexpression error still counts as "not yet", since the call itself succeeded.A per-tool requirement (a profile forcing
on: untilon every step that calls a tool) is not included: tools are declared per flow, not per step, so Lest cannot tell which step calls which tool.Tests
retry_on_until_stops_at_the_first_failed_attempt: the second attempt fails, the step fails at attempt 2 with that attempt's error, and one retry event is emitted.retry_on_until_keeps_polling_while_the_condition_is_false: polls to success, and fails when attempts run out.retry_by_default_still_repeats_a_failed_attempt: the default is unchanged.retry_on_until_needs_a_condition(validation).make checkpasses except for timing-based tests (cancel at 500 ms, parallel group, service shutdown) that fail intermittently on a heavily loaded machine. A different one fails on each run, none touch retry, and the runner suite passes with--test-threads=2.