From 1c2e52929579a2cc2747881b76a4b6f0a646866a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCttler?= Date: Tue, 3 Feb 2026 12:09:57 +0100 Subject: [PATCH] e2e tests netpol: Set getProbeTimeoutSeconds to 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before tests sometimes failed randomly. For example: > [It] [sig-network] Netpol NetworkPolicy between server and client should allow ingress access from updated namespace [Feature:NetworkPolicy] Related: https://kubernetes.slack.com/archives/C09QYUH5W/p1770111316158039 Signed-off-by: Thomas Güttler Update test/e2e/network/netpol/kubemanager.go Co-authored-by: Antonio Ojea Signed-off-by: Thomas Güttler --- test/e2e/network/netpol/kubemanager.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/e2e/network/netpol/kubemanager.go b/test/e2e/network/netpol/kubemanager.go index ebe5c98e95b..f3861f51671 100644 --- a/test/e2e/network/netpol/kubemanager.go +++ b/test/e2e/network/netpol/kubemanager.go @@ -321,13 +321,15 @@ func (k *kubeManager) getNamespace(ctx context.Context, ns string) (*v1.Namespac return selectedNameSpace, nil } -// getProbeTimeoutSeconds returns a timeout for how long the probe should work before failing a check, and takes windows heuristics into account, where requests can take longer sometimes. +// getProbeTimeoutSeconds returns a timeout for how long the probe should work before failing a +// check. The 3-second timeout not only ensures probe reliability across different platforms, +// but also serves as an assertion on the non-functional requirement that the dataplane must +// program network policies within an acceptable latency. This is especially critical for +// network policy features where slow dataplane programming could impact connectivity and security. +// The 3-second threshold was determined through empirical evidence as the maximum acceptable +// latency for network policy enforcement. func getProbeTimeoutSeconds() int { - timeoutSeconds := 1 - if framework.NodeOSDistroIs("windows") { - timeoutSeconds = 3 - } - return timeoutSeconds + return 3 } // getWorkers returns the number of workers suggested to run when testing.