We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When a string representation of a duration is used on the retryStrategy.Duration field it defaults to 0.
The following yaml will not work since https://github.com/argoproj/argo-events/blob/master/common/retry.go#L56 looks at the Int64Value() only for the duration field
retryStrategy: steps: 10 duration: "2s"
This workaround can be used in the interim
retryStrategy: steps: 10 duration: 2000000000
To Reproduce Steps to reproduce the behavior: Created two tests in retry_test.go
func TestConnectDurationBug(t *testing.T) { start := time.Now() count := 4 err := Connect(nil, func() error { if count == 0 { return nil } else { count-- return fmt.Errorf("new error") } }) end := time.Now() elapsed := end.Sub(start) assert.NoError(t, err) assert.Equal(t, 0, count) assert.True(t, elapsed >= 4 * time.Second) //Will fail as the duration defaults to 0 } func TestConnectRetry(t *testing.T) { factor := apicommon.NewAmount("1.0") jitter := apicommon.NewAmount("1") duration := apicommon.FromInt64(1000000000) //This must be set as int64 backoff := apicommon.Backoff{ Duration: &duration, Factor: &factor, Jitter: &jitter, Steps: 5, } count := 4 start := time.Now() err := Connect(&backoff, func() error { if count == 0 { return nil } else { count-- return fmt.Errorf("new error") } }) end := time.Now() elapsed := end.Sub(start) assert.NoError(t, err) assert.Equal(t, 0, count) assert.True(t, elapsed >= 4 * time.Second) //Will pass }
Expected behavior retries will backoff using a duration that is not 0
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered:
fix: retry duration recognize strings. Fixes argoproj#1200
ca5f515
Signed-off-by: Derek Wang <[email protected]>
Good catch! Thanks!
Sorry, something went wrong.
08b4fed
fix: retry duration recognize strings. Fixes #1200 (#1201)
a4e03a9
fix: retry duration recognize strings. Fixes argoproj#1200 (argoproj#…
5872e46
…1201) Signed-off-by: Derek Wang <[email protected]>
No branches or pull requests
When a string representation of a duration is used on the retryStrategy.Duration field it defaults to 0.
The following yaml will not work since https://github.com/argoproj/argo-events/blob/master/common/retry.go#L56 looks at the Int64Value() only for the duration field
This workaround can be used in the interim
To Reproduce
Steps to reproduce the behavior:
Created two tests in retry_test.go
Expected behavior
retries will backoff using a duration that is not 0
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: