Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
Signed-off-by: shuangkun <tsk2013uestc@163.com>
  • Loading branch information
shuangkun committed Mar 22, 2024
1 parent 82d2d10 commit 678c764
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ func (woc *wfOperationCtx) podReconciliation(ctx context.Context) (error, bool)
node.Daemoned = nil
woc.updated = true
}
woc.markNodePhase(node.Name, wfv1.NodeError, "pod deleted")
woc.markNodeError(node.Name, errors.New("", "pod deleted"))
// Set pod's child(container) error if pod deleted
for _, childNodeID := range node.Children {
childNode, err := woc.wf.Status.Nodes.Get(childNodeID)
Expand Down
5 changes: 3 additions & 2 deletions workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10843,8 +10843,8 @@ spec:
podGC:
strategy: OnPodCompletion`

// TestContainerSetDoesNotStopContainerWhenPodRemoved test whether a workflow has ContainerSet error when pod removed.
func TestContainerSetDoesNotStopContainerWhenPodRemoved(t *testing.T) {
// 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()
Expand Down Expand Up @@ -10890,4 +10890,5 @@ func TestContainerSetDoesNotStopContainerWhenPodRemoved(t *testing.T) {
assert.Equal(t, "container deleted", node.Message)
}
}
_ = os.Unsetenv("RECENTLY_STARTED_POD_DURATION")
}

0 comments on commit 678c764

Please sign in to comment.