Skip to content

Commit

Permalink
fix: comment
Browse files Browse the repository at this point in the history
Signed-off-by: shuangkun <tsk2013uestc@163.com>
  • Loading branch information
shuangkun committed Mar 24, 2024
1 parent 9fe5934 commit 19d2f5c
Show file tree
Hide file tree
Showing 2 changed files with 2 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{GracePeriodSeconds: pointer.Int64Ptr(0)})
err := woc.controller.kubeclientset.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{})
if err != nil {
panic(err)
}
Expand Down
3 changes: 1 addition & 2 deletions workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10845,7 +10845,6 @@ spec:

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

// delete pod
time.Sleep(1 * time.Second)
deletePods(ctx, woc)
pods, err = listPods(woc)
assert.Nil(t, err)
Expand All @@ -10890,5 +10890,4 @@ func TestContainerSetDeleteContainerWhenPodDeleted(t *testing.T) {
assert.Equal(t, "container deleted", node.Message)
}
}
_ = os.Unsetenv("RECENTLY_STARTED_POD_DURATION")
}

0 comments on commit 19d2f5c

Please sign in to comment.