Skip to content

Commit

Permalink
fix: e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: shuangkun <tsk2013uestc@163.com>
  • Loading branch information
shuangkun committed Feb 27, 2024
1 parent 7a64c72 commit 3b5265c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/e2e/fixtures/when.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ var (
return node.Type == wfv1.NodeTypePod && node.Phase == wfv1.NodeRunning
}), "to have running pod"
}
ToHaveFailedPod Condition = func(wf *wfv1.Workflow) (bool, string) {
return wf.Status.Nodes.Any(func(node wfv1.NodeStatus) bool {
return node.Type == wfv1.NodeTypePod && node.Phase == wfv1.NodeFailed
}), "to have failed pod"
}
)

// `ToBeDone` replaces `ToFinish` which also makes sure the workflow is both complete not pending archiving.
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ spec:
`).
When().
SubmitWorkflow().
WaitForWorkflow(time.Second * 30).
WaitForWorkflow(fixtures.ToHaveFailedPod).
Wait(5 * time.Second).
Then().
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) {
if status.Phase == wfv1.WorkflowFailed {
Expand Down

0 comments on commit 3b5265c

Please sign in to comment.