diff --git a/test/e2e_node/container_lifecycle_pod_construction.go b/test/e2e_node/container_lifecycle_pod_construction.go index b8220919c49..9c69d7254ba 100644 --- a/test/e2e_node/container_lifecycle_pod_construction.go +++ b/test/e2e_node/container_lifecycle_pod_construction.go @@ -179,24 +179,6 @@ func (o containerOutputList) StartsBefore(lhs, rhs string) error { return nil } -// DoesntStartAfter returns an error if lhs started after rhs -func (o containerOutputList) DoesntStartAfter(lhs, rhs string) error { - rhsStart := o.findIndex(rhs, "Starting", 0) - - if rhsStart == -1 { - return fmt.Errorf("couldn't find that %s ever started, got\n%v", rhs, o) - } - - // this works even for the same names (restart case) - lhsStart := o.findIndex(lhs, "Started", rhsStart+1) - - if lhsStart != -1 { - return fmt.Errorf("expected %s to not start after %s, got\n%v", lhs, rhs, o) - } - - return nil -} - // ExitsBefore returns an error if lhs did not end before rhs func (o containerOutputList) ExitsBefore(lhs, rhs string) error { lhsExit := o.findIndex(lhs, "Exiting", 0) diff --git a/test/e2e_node/container_lifecycle_test.go b/test/e2e_node/container_lifecycle_test.go index 0c6150f9c61..5ed99eabb25 100644 --- a/test/e2e_node/container_lifecycle_test.go +++ b/test/e2e_node/container_lifecycle_test.go @@ -1631,7 +1631,7 @@ var _ = SIGDescribe(nodefeature.SidecarContainers, "Containers Lifecycle", func( results = parseOutput(context.TODO(), f, podSpec) }) ginkgo.It("should not restart a restartable init container", func() { - framework.ExpectNoError(results.DoesntStartAfter(restartableInit1, regular1)) + framework.ExpectNoError(results.HasNotRestarted(restartableInit1)) }) ginkgo.It("should run a regular container to completion", func() { framework.ExpectNoError(results.Exits(regular1)) @@ -2033,7 +2033,7 @@ var _ = SIGDescribe(nodefeature.SidecarContainers, "Containers Lifecycle", func( results = parseOutput(context.TODO(), f, podSpec) }) ginkgo.It("should not restart a restartable init container", func() { - framework.ExpectNoError(results.DoesntStartAfter(restartableInit1, regular1)) + framework.ExpectNoError(results.HasNotRestarted(restartableInit1)) }) ginkgo.It("should run a regular container to completion", func() { framework.ExpectNoError(results.Exits(regular1)) @@ -2454,7 +2454,7 @@ var _ = SIGDescribe(nodefeature.SidecarContainers, "Containers Lifecycle", func( }) ginkgo.It("should not restart a restartable init container", func() { - framework.ExpectNoError(results.DoesntStartAfter(restartableInit1, regular1)) + framework.ExpectNoError(results.HasNotRestarted(restartableInit1)) }) // this test case is different from restartPolicy=Never ginkgo.It("should start a regular container", func() {