@@ -19,6 +19,7 @@ import (
1919
2020 nodeutils "github.com/openshift/origin/test/extended/node"
2121 exutil "github.com/openshift/origin/test/extended/util"
22+ "github.com/openshift/origin/test/extended/util/image"
2223)
2324
2425var _ = g .Describe ("[sig-node] Probe configuration" , func () {
@@ -49,22 +50,10 @@ var _ = g.Describe("[sig-node] Probe configuration", func() {
4950 },
5051 Spec : corev1.PodSpec {
5152 TerminationGracePeriodSeconds : ptr.To [int64 ](60 ),
52- SecurityContext : & corev1.PodSecurityContext {
53- RunAsNonRoot : ptr .To (true ),
54- SeccompProfile : & corev1.SeccompProfile {
55- Type : corev1 .SeccompProfileTypeRuntimeDefault ,
56- },
57- },
5853 Containers : []corev1.Container {
5954 {
60- Name : "test" ,
61- Image : "quay.io/openshifttest/nginx-alpine@sha256:04f316442d48ba60e3ea0b5a67eb89b0b667abf1c198a3d0056ca748736336a0" ,
62- SecurityContext : & corev1.SecurityContext {
63- AllowPrivilegeEscalation : ptr .To (false ),
64- Capabilities : & corev1.Capabilities {
65- Drop : []corev1.Capability {"ALL" },
66- },
67- },
55+ Name : "test" ,
56+ Image : image .ShellImage (),
6857 Command : []string {"sh" , "-c" , "sleep 100000000" },
6958 Ports : []corev1.ContainerPort {
7059 {ContainerPort : 8080 },
@@ -91,6 +80,7 @@ var _ = g.Describe("[sig-node] Probe configuration", func() {
9180
9281 g .By ("Verify probe-level terminationGracePeriodSeconds is honored (10s)" )
9382 expectedSec := 10
83+ // Allow asymmetric tolerance: -3s for event timing precision, +10s for container cleanup overhead
9484 minSec := expectedSec - 3
9585 maxSec := expectedSec + 10
9686 timeDiff , err := verifyProbeTermination (ctx , oc , namespace , "liveness-probe-level" , "test" , expectedSec )
@@ -114,22 +104,10 @@ var _ = g.Describe("[sig-node] Probe configuration", func() {
114104 },
115105 Spec : corev1.PodSpec {
116106 TerminationGracePeriodSeconds : ptr.To [int64 ](60 ),
117- SecurityContext : & corev1.PodSecurityContext {
118- RunAsNonRoot : ptr .To (true ),
119- SeccompProfile : & corev1.SeccompProfile {
120- Type : corev1 .SeccompProfileTypeRuntimeDefault ,
121- },
122- },
123107 Containers : []corev1.Container {
124108 {
125- Name : "teststartup" ,
126- Image : "quay.io/openshifttest/nginx-alpine@sha256:04f316442d48ba60e3ea0b5a67eb89b0b667abf1c198a3d0056ca748736336a0" ,
127- SecurityContext : & corev1.SecurityContext {
128- AllowPrivilegeEscalation : ptr .To (false ),
129- Capabilities : & corev1.Capabilities {
130- Drop : []corev1.Capability {"ALL" },
131- },
132- },
109+ Name : "teststartup" ,
110+ Image : image .ShellImage (),
133111 Command : []string {"sh" , "-c" , "sleep 100000000" },
134112 Ports : []corev1.ContainerPort {
135113 {ContainerPort : 8080 },
@@ -156,6 +134,7 @@ var _ = g.Describe("[sig-node] Probe configuration", func() {
156134
157135 g .By ("Verify probe-level terminationGracePeriodSeconds is honored (10s)" )
158136 expectedSec := 10
137+ // Allow asymmetric tolerance: -3s for event timing precision, +10s for container cleanup overhead
159138 minSec := expectedSec - 3
160139 maxSec := expectedSec + 10
161140 timeDiff , err := verifyProbeTermination (ctx , oc , namespace , "startup-probe-level" , "teststartup" , expectedSec )
@@ -179,22 +158,10 @@ var _ = g.Describe("[sig-node] Probe configuration", func() {
179158 },
180159 Spec : corev1.PodSpec {
181160 TerminationGracePeriodSeconds : ptr.To [int64 ](60 ),
182- SecurityContext : & corev1.PodSecurityContext {
183- RunAsNonRoot : ptr .To (true ),
184- SeccompProfile : & corev1.SeccompProfile {
185- Type : corev1 .SeccompProfileTypeRuntimeDefault ,
186- },
187- },
188161 Containers : []corev1.Container {
189162 {
190- Name : "test" ,
191- Image : "quay.io/openshifttest/nginx-alpine@sha256:04f316442d48ba60e3ea0b5a67eb89b0b667abf1c198a3d0056ca748736336a0" ,
192- SecurityContext : & corev1.SecurityContext {
193- AllowPrivilegeEscalation : ptr .To (false ),
194- Capabilities : & corev1.Capabilities {
195- Drop : []corev1.Capability {"ALL" },
196- },
197- },
163+ Name : "test" ,
164+ Image : image .ShellImage (),
198165 Command : []string {"sh" , "-c" , "sleep 100000000" },
199166 Ports : []corev1.ContainerPort {
200167 {ContainerPort : 8080 },
@@ -221,6 +188,7 @@ var _ = g.Describe("[sig-node] Probe configuration", func() {
221188
222189 g .By ("Verify pod-level terminationGracePeriodSeconds is used (60s)" )
223190 expectedSec := 60
191+ // Allow asymmetric tolerance: -3s for event timing precision, +10s for container cleanup overhead
224192 minSec := expectedSec - 3
225193 maxSec := expectedSec + 10
226194 timeDiff , err := verifyProbeTermination (ctx , oc , namespace , "liveness-pod-level" , "test" , expectedSec )
0 commit comments