Skip to content

Commit

Permalink
fix test case for fastFail
Browse files Browse the repository at this point in the history
Signed-off-by: Goober <chenhao86899@gmail.com>
  • Loading branch information
JasonChen86899 committed Oct 13, 2023
1 parent f053dea commit 0978c4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions workflow/controller/dag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ func TestRetryStrategyNodes(t *testing.T) {
assert.Equal(t, wfv1.NodePending, onExitNode.Phase)
}

assert.Equal(t, wfv1.WorkflowRunning, woc.wf.Status.Phase)
assert.Equal(t, wfv1.WorkflowCanceled, woc.wf.Status.Phase)
}

var testOnExitNodeDAGPhase = `
Expand Down Expand Up @@ -1847,7 +1847,7 @@ func TestOnExitDAGPhase(t *testing.T) {
retryNode, err := woc.wf.GetNodeByName("dag-diamond-88trp")
if assert.NoError(t, err) {
assert.NotNil(t, retryNode)
assert.Equal(t, wfv1.NodeRunning, retryNode.Phase)
assert.Equal(t, wfv1.NodeSucceeded, retryNode.Phase)
}

retryNode, err = woc.wf.GetNodeByName("dag-diamond-88trp.B.onExit")
Expand All @@ -1856,7 +1856,7 @@ func TestOnExitDAGPhase(t *testing.T) {
assert.Equal(t, wfv1.NodePending, retryNode.Phase)
}

assert.Equal(t, wfv1.WorkflowRunning, woc.wf.Status.Phase)
assert.Equal(t, wfv1.WorkflowSucceeded, woc.wf.Status.Phase)
}

var testOnExitNonLeaf = `
Expand Down
4 changes: 2 additions & 2 deletions workflow/controller/exit_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func TestDAGOnExit(t *testing.T) {
}
woc3 := newWorkflowOperationCtx(woc2.wf, controller)
woc3.operate(ctx)
assert.Equal(t, wfv1.WorkflowRunning, woc3.wf.Status.Phase)
assert.Equal(t, wfv1.WorkflowSucceeded, woc3.wf.Status.Phase)
onExitNodeIsPresent = false
for _, node := range woc3.wf.Status.Nodes {
if node.Phase == wfv1.NodePending && strings.Contains(node.Name, "onExit") {
Expand Down Expand Up @@ -997,5 +997,5 @@ status:
assert.Len(t, taskSets.Items, 0)
}
woc.operate(ctx)
assert.Equal(t, woc.wf.Status.Phase, wfv1.WorkflowRunning)
assert.Equal(t, wfv1.WorkflowSucceeded, woc.wf.Status.Phase)
}

0 comments on commit 0978c4d

Please sign in to comment.