diff --git a/test/e2e/fixtures/when.go b/test/e2e/fixtures/when.go index eb3d5dc7c48b..46cd1241bebe 100644 --- a/test/e2e/fixtures/when.go +++ b/test/e2e/fixtures/when.go @@ -347,6 +347,7 @@ func (w *When) WaitForWorkflowList(listOptions metav1.ListOptions, condition fun return w } } + time.Sleep(time.Second) } } diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index 369ada6474ca..8f078223b7f9 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -804,6 +804,10 @@ func (woc *wfOperationCtx) persistUpdates(ctx context.Context) { woc.log.WithError(err).Warn("failed to delete task-results") } } + // If Finalizer exists, requeue to make sure Finalizer can be removed. + if woc.wf.Status.Fulfilled() && len(wf.GetFinalizers()) > 0 { + woc.requeueAfter(5 * time.Second) + } // It is important that we *never* label pods as completed until we successfully updated the workflow // Failing to do so means we can have inconsistent state.