Skip to content

Commit

Permalink
fix: rename const
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin committed Nov 29, 2024
1 parent 59bdce3 commit 4224930
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/agent/testworkflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
const testWorkflowNotificationsRetryCount = 10

var (
retryDelay = 100 * time.Millisecond
waitTimeout = 24 * time.Hour
logRetryDelay = 100 * time.Millisecond
serviceWaitTimeout = 24 * time.Hour
)

func getTestWorkflowNotificationType(n testkube.TestWorkflowExecutionNotification) cloud.TestWorkflowNotificationType {
Expand Down Expand Up @@ -190,7 +190,7 @@ func (ag *Agent) executeWorkflowNotificationsRequest(ctx context.Context, req *c
// Cloud sometimes slow to insert execution or test
// while WorkflowNotifications request from websockets comes in faster
// so we retry up to testWorkflowNotificationsRetryCount times.
time.Sleep(retryDelay)
time.Sleep(logRetryDelay)
notificationsCh, err = ag.testWorkflowNotificationsFunc(ctx, req.ExecutionId)
}
}
Expand Down Expand Up @@ -243,7 +243,7 @@ func (ag *Agent) executeWorkflowNotificationsRequest(ctx context.Context, req *c
}

func (ag *Agent) executeWorkflowServiceNotificationsRequest(ctx context.Context, req *cloud.TestWorkflowServiceNotificationsRequest) error {
timeoutCtx, cancel := context.WithTimeout(ctx, waitTimeout)
timeoutCtx, cancel := context.WithTimeout(ctx, serviceWaitTimeout)
defer cancel()

notificationsCh, err := retry.DoWithData(
Expand All @@ -255,7 +255,7 @@ func (ag *Agent) executeWorkflowServiceNotificationsRequest(ctx context.Context,
return ag.testWorkflowServiceNotificationsFunc(ctx, req.ExecutionId, req.ServiceName, int(req.ServiceIndex))
},
retry.DelayType(retry.FixedDelay),
retry.Delay(retryDelay),
retry.Delay(logRetryDelay),
retry.Context(timeoutCtx),
retry.RetryIf(func(err error) bool {
return errors.Is(err, registry.ErrResourceNotFound)
Expand Down

0 comments on commit 4224930

Please sign in to comment.