From 68ce3cf3d47c4ba48ee004165174660d5a09bd6b Mon Sep 17 00:00:00 2001 From: Amim Knabben Date: Sat, 19 Sep 2020 22:31:39 -0400 Subject: [PATCH] Verify pod termination with E2E PreStop hook --- test/e2e/node/pre_stop.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/node/pre_stop.go b/test/e2e/node/pre_stop.go index bc7308753f4..ca31cff120b 100644 --- a/test/e2e/node/pre_stop.go +++ b/test/e2e/node/pre_stop.go @@ -187,10 +187,11 @@ var _ = SIGDescribe("PreStop", func() { err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(gracefulTerminationPeriodSeconds)) framework.ExpectNoError(err, "failed to delete pod") - //wait up to graceful termination period seconds - time.Sleep(30 * time.Second) + // wait for less than the gracePeriod termination ensuring the + // preStop hook is still executing. + time.Sleep(15 * time.Second) - ginkgo.By("verifying the pod running state after graceful termination") + ginkgo.By("verifying the pod is running while in the graceful period termination") result := &v1.PodList{} err = wait.Poll(time.Second*5, time.Second*60, func() (bool, error) { client, err := e2ekubelet.ProxyRequest(f.ClientSet, pod.Spec.NodeName, "pods", ports.KubeletPort)