Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
Signed-off-by: shuangkun <[email protected]>
  • Loading branch information
shuangkun committed Mar 19, 2024
1 parent 4967ec9 commit fb904b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion workflow/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ func makePodsPhase(ctx context.Context, woc *wfOperationCtx, phase apiv1.PodPhas
func deletePods(ctx context.Context, woc *wfOperationCtx) {
for _, obj := range woc.controller.podInformer.GetStore().List() {
pod := obj.(*apiv1.Pod)
err := woc.controller.kubeclientset.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{})
err := woc.controller.kubeclientset.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{GracePeriodSeconds: pointer.Int64Ptr(0)})
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ func (woc *wfOperationCtx) podReconciliation(ctx context.Context) (error, bool)
continue
}
if childNode.Type == wfv1.NodeTypeContainer {
woc.markNodePhase(childNode.Name, wfv1.NodeError, "container deleted")
woc.markNodeError(childNode.Name, errors.New("","container deleted"))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10377,6 +10377,7 @@ spec:

// TestContainerSetDoesNotStopContainerWhenPodRemoved test whether a workflow has ContainerSet error when pod removed.
func TestContainerSetDoesNotStopContainerWhenPodRemoved(t *testing.T) {
_ = os.Setenv("RECENTLY_STARTED_POD_DURATION", "0")
cancel, controller := newController()
defer cancel()
ctx := context.Background()
Expand All @@ -10403,7 +10404,6 @@ func TestContainerSetDoesNotStopContainerWhenPodRemoved(t *testing.T) {
}

// delete pod
time.Sleep(10 * time.Second)
deletePods(ctx, woc)
pods, err = listPods(woc)
assert.Nil(t, err)
Expand Down

0 comments on commit fb904b8

Please sign in to comment.