You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.35 when this version cannot be emulated any longer
@@ -560,6 +560,11 @@ var _ = SIGDescribe(feature.PodLifecycleSleepAction, func() {
560
560
ginkgo.BeforeEach(func(ctx context.Context) {
561
561
podClient=e2epod.NewPodClient(f)
562
562
})
563
+
/*
564
+
Release : v1.32
565
+
Testname: Pod Lifecycle, prestop sleep hook
566
+
Description: When a pre-stop handler is specified in the container lifecycle using a 'Sleep' action, then the handler MUST be invoked before the container is terminated. A test pod will be created to verify if its termination time aligns with the sleep time specified when it is terminated.
567
+
*/
563
568
ginkgo.It("valid prestop hook using sleep action", func(ctx context.Context) {
564
569
lifecycle:=&v1.Lifecycle{
565
570
PreStop: &v1.LifecycleHandler{
@@ -580,32 +585,40 @@ var _ = SIGDescribe(feature.PodLifecycleSleepAction, func() {
580
585
framework.Failf("unexpected delay duration before killing the pod, cost = %v", cost)
581
586
}
582
587
})
583
-
588
+
/*
589
+
Release : v1.32
590
+
Testname: Pod Lifecycle, prestop sleep hook with low gracePeriodSeconds
591
+
Description: When a pre-stop handler is specified in the container lifecycle using a 'Sleep' action, then the handler MUST be invoked before the container is terminated. A test pod will be created, and its `gracePeriodSeconds` will be modified to a value less than the sleep time before termination. The termination time will then be checked to ensure it aligns with the `gracePeriodSeconds` value.
592
+
*/
584
593
ginkgo.It("reduce GracePeriodSeconds during runtime", func(ctx context.Context) {
// longer than 2 seconds (we change gracePeriodSeconds to 2 seconds here, and it's less than sleep action)
607
+
// longer than 5 seconds (we change gracePeriodSeconds to 5 seconds here, and it's less than sleep action)
599
608
// shorter than sleep action (to make sure it doesn't take effect)
600
-
if!validDuration(cost, 2, 15) {
609
+
if!validDuration(cost, 5, 15) {
601
610
framework.Failf("unexpected delay duration before killing the pod, cost = %v", cost)
602
611
}
603
612
})
604
-
613
+
/*
614
+
Release : v1.32
615
+
Testname: Pod Lifecycle, prestop sleep hook with erroneous startup command
616
+
Description: When a pre-stop handler is specified in the container lifecycle using a 'Sleep' action, then the handler MUST be invoked before the container is terminated. A test pod with an erroneous startup command will be created, and upon termination, it will be checked whether it ignored the sleep time.
0 commit comments