-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
fix: retryStrategy.Limit is now read properly for backoff strategy. Fixes #9170. #9213
Conversation
Signed-off-by: Dillen Padhiar <[email protected]>
Signed-off-by: Dillen Padhiar <[email protected]>
Signed-off-by: Dillen Padhiar <[email protected]>
test/e2e/retry_test.go
Outdated
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowPhase("Failed"), status.Phase) | ||
assert.Equal(t, "Max duration limit exceeded", status.Message) |
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.
I think you need to validate the number of retries since the issue is "string" limit
does not get interpret correctly
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.
In this case, we could check the length of child nodes at the end of the run which should be 5 based on the backoff time.
@@ -898,7 +898,7 @@ func (woc *wfOperationCtx) processNodeRetries(node *wfv1.NodeStatus, retryStrate | |||
} | |||
|
|||
// See if we have waited past the deadline | |||
if time.Now().Before(waitingDeadline) && retryStrategy.Limit != nil && int32(len(node.Children)) <= retryStrategy.Limit.IntVal { | |||
if time.Now().Before(waitingDeadline) && retryStrategy.Limit != nil && int32(len(node.Children)) <= int32(retryStrategy.Limit.IntValue()) { |
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.
👍
Signed-off-by: Dillen Padhiar <[email protected]>
templates: | ||
- name: main | ||
retryStrategy: | ||
limit: 10 |
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.
I should've pointed this out last time, since the error is with the intstring conversion maybe we should test both '10'
and 10
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.
Will add a separate workflow to test this, good idea.
Signed-off-by: Dillen Padhiar <[email protected]>
…ixes #9170. (#9213) * fix: retryStrategy.Limit is now read properly Signed-off-by: Dillen Padhiar <[email protected]> * test: add test case for backoff Signed-off-by: Dillen Padhiar <[email protected]> * chore: empty commit Signed-off-by: Dillen Padhiar <[email protected]> * test: update test case to check for certain amount of retries Signed-off-by: Dillen Padhiar <[email protected]> * test: added second case where limit is a string Signed-off-by: Dillen Padhiar <[email protected]>
am on v3.3.9 but backoff doesnt seem to apply any delays between retries |
…ixes argoproj#9170. (argoproj#9213) * fix: retryStrategy.Limit is now read properly Signed-off-by: Dillen Padhiar <[email protected]> * test: add test case for backoff Signed-off-by: Dillen Padhiar <[email protected]> * chore: empty commit Signed-off-by: Dillen Padhiar <[email protected]> * test: update test case to check for certain amount of retries Signed-off-by: Dillen Padhiar <[email protected]> * test: added second case where limit is a string Signed-off-by: Dillen Padhiar <[email protected]> Signed-off-by: juchao <[email protected]>
…ixes argoproj#9170. (argoproj#9213) * fix: retryStrategy.Limit is now read properly Signed-off-by: Dillen Padhiar <[email protected]> * test: add test case for backoff Signed-off-by: Dillen Padhiar <[email protected]> * chore: empty commit Signed-off-by: Dillen Padhiar <[email protected]> * test: update test case to check for certain amount of retries Signed-off-by: Dillen Padhiar <[email protected]> * test: added second case where limit is a string Signed-off-by: Dillen Padhiar <[email protected]> Signed-off-by: Reddy <[email protected]>
Signed-off-by: Dillen Padhiar [email protected]
Fixes #9170
Previously, this if statement always evaluated to false if you set a
Limit
forRetryStrategy
as theretryStrategy.Limit.IntVal
always equaled 0. The appropriate way to get the integer value from aintstr.IntOrString
is to useIntValue
which returns an int we cast toint32
.