Skip to content

Commit

Permalink
[bug fix] step retries for max retry even if step state is not error
Browse files Browse the repository at this point in the history
  • Loading branch information
TanmoySG committed Nov 7, 2024
1 parent 3833669 commit 610edd7
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions go_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (step *Step) shouldRetry() bool {
return true
}

if step.StepOpts.RetryAllErrors {
if step.stepResult.StepState == StepStateError && step.StepOpts.RetryAllErrors {
return true
}

Expand All @@ -161,14 +161,10 @@ func (step *Step) shouldExit() bool {
return false
}

if step.StepOpts.MaxRunAttempts == step.stepRunProgress.runCount {
switch step.stepResult.StepState {
case StepStateComplete, StepStateSkipped:
return false
default: // StepStateError, StepStatePending, StepStateFailed
return true
}
switch step.stepResult.StepState {
case StepStateComplete, StepStateSkipped:
return false
default: // StepStateError, StepStatePending, StepStateFailed
return true
}

return false
}

0 comments on commit 610edd7

Please sign in to comment.