From 97b5bd3bce3065d2b2a57f485c41fc58af0f2b25 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Fri, 29 Nov 2024 17:20:14 +0300 Subject: [PATCH 1/2] fix: use option Signed-off-by: Vladislav Sukhin --- pkg/agent/testworkflows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/agent/testworkflows.go b/pkg/agent/testworkflows.go index 5edc96336a..bd477932a0 100644 --- a/pkg/agent/testworkflows.go +++ b/pkg/agent/testworkflows.go @@ -260,7 +260,7 @@ func (ag *Agent) executeWorkflowServiceNotificationsRequest(ctx context.Context, retry.RetryIf(func(err error) bool { return errors.Is(err, registry.ErrResourceNotFound) }), - retry.Attempts(0), + retry.UntilSucceeded(), ) if err != nil { From 3e2c45f31951c61db0a825b014928e5b2f6a173c Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Fri, 29 Nov 2024 17:26:51 +0300 Subject: [PATCH 2/2] fix: remove ctx Signed-off-by: Vladislav Sukhin --- pkg/agent/testworkflows.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/agent/testworkflows.go b/pkg/agent/testworkflows.go index bd477932a0..c70a28224f 100644 --- a/pkg/agent/testworkflows.go +++ b/pkg/agent/testworkflows.go @@ -243,9 +243,6 @@ 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, serviceWaitTimeout) - defer cancel() - notificationsCh, err := retry.DoWithData( func() (<-chan testkube.TestWorkflowExecutionNotification, error) { // We have a race condition here @@ -256,7 +253,6 @@ func (ag *Agent) executeWorkflowServiceNotificationsRequest(ctx context.Context, }, retry.DelayType(retry.FixedDelay), retry.Delay(logRetryDelay), - retry.Context(timeoutCtx), retry.RetryIf(func(err error) bool { return errors.Is(err, registry.ErrResourceNotFound) }),