Skip to content

Commit 1ec3345

Browse files
authored
Merge pull request kubernetes#94922 from knabben/pre-stop-e2e
Verify pod termination with E2E PreStop hook
2 parents deebe66 + 68ce3cf commit 1ec3345

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/e2e/node/pre_stop.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,11 @@ var _ = SIGDescribe("PreStop", func() {
187187
err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(gracefulTerminationPeriodSeconds))
188188
framework.ExpectNoError(err, "failed to delete pod")
189189

190-
//wait up to graceful termination period seconds
191-
time.Sleep(30 * time.Second)
190+
// wait for less than the gracePeriod termination ensuring the
191+
// preStop hook is still executing.
192+
time.Sleep(15 * time.Second)
192193

193-
ginkgo.By("verifying the pod running state after graceful termination")
194+
ginkgo.By("verifying the pod is running while in the graceful period termination")
194195
result := &v1.PodList{}
195196
err = wait.Poll(time.Second*5, time.Second*60, func() (bool, error) {
196197
client, err := e2ekubelet.ProxyRequest(f.ClientSet, pod.Spec.NodeName, "pods", ports.KubeletPort)

0 commit comments

Comments
 (0)