fix(iteration): Pointless waiting before a known timeout #27
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.
Every time a timeout occurs, there is one second consumed for nothing.
Illustration
Since there is no attempt made after the third waiting, the outcome of such 3-seconds execution depends entirely on the first three attempts. And a known failure is always projected to one second later into the future, despite the insignificance of further waiting.
With 23bbf6d, there will be a fourth attempt:
It is more natural to use TIMEOUT + 1 as the maximum number of attempts.
Other changes
22d68b4 - feat(option): Restrict the timeout input to non-negative integers
526918b - feat(option): Support more conventional formats in the option parser
This is what I created this PR for in the first place.
9964904 - fix(command): Restore environment variables before calling
exec
By using positional parameters, we avoid transferring the problem endlessly to other variables: