Skip to content
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

feat: Retry pending nodes #2385

Merged
merged 21 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Possible fix
  • Loading branch information
simster7 committed Mar 13, 2020
commit da3ba82239d51329618a4832b9cfdf4d31e90183
55 changes: 54 additions & 1 deletion test/e2e/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (s *FunctionalSuite) TestPendingRetryWorkflow() {
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: dag-limited
name: dag-limited-1
labels:
argo-e2e: true
spec:
Expand Down Expand Up @@ -230,6 +230,59 @@ spec:
s.TearDownSuite()
}

// 128M is for argo executor
func (s *FunctionalSuite) TestPendingRetryWorkflowWithRetryStrategy() {
s.Given().
Workflow(`
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: dag-limited-2
labels:
argo-e2e: true
spec:
entrypoint: dag
templates:
- name: cowsay
resubmitPendingPods: true
retryStrategy:
limit: 1
container:
image: cowsay:v1
command: [sh, -c]
args: ["cowsay a"]
resources:
limits:
memory: 128M
- name: dag
dag:
tasks:
- name: a
template: cowsay
- name: b
template: cowsay
`).
When().
MemoryQuota("130M").
SubmitWorkflow().
WaitForWorkflowToStart(5*time.Second).
WaitForWorkflowCondition(func(wf *wfv1.Workflow) bool {
a := wf.Status.Nodes.FindByDisplayName("a(0)")
b := wf.Status.Nodes.FindByDisplayName("b(0)")
return wfv1.NodePending == a.Phase &&
regexp.MustCompile(`^Pending \d+\.\d+s$`).MatchString(a.Message) &&
wfv1.NodePending == b.Phase &&
regexp.MustCompile(`^Pending \d+\.\d+s$`).MatchString(b.Message)
}, "pods pending", 20*time.Second).
DeleteQuota().
WaitForWorkflowCondition(func(wf *wfv1.Workflow) bool {
a := wf.Status.Nodes.FindByDisplayName("a(0)")
b := wf.Status.Nodes.FindByDisplayName("b(0)")
return wfv1.NodeSucceeded == a.Phase && wfv1.NodeSucceeded == b.Phase
}, "pods succeeded", 20*time.Second)
s.TearDownSuite()
}

func (s *FunctionalSuite) TestparameterAggregation() {
s.Given().
Workflow("@functional/param-aggregation.yaml").
Expand Down
1 change: 1 addition & 0 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,7 @@ func (woc *wfOperationCtx) executeContainer(nodeName string, templateScope strin

if apierr.IsForbidden(err) && isResubmitAllowed(tmpl) {
// Our error was most likely caused by a lack of resources. If pod resubmission is allowed, keep the node pending
woc.requeue(0)
return woc.markNodePending(node.Name, err), nil
}
return node, err
Expand Down