From 466fb8152872345bc5ee5515b1e0053d5ebd0b2b Mon Sep 17 00:00:00 2001 From: Fabio Bertinatto Date: Thu, 22 May 2025 14:20:17 -0300 Subject: [PATCH] test/e2e/apimachinery/namespace.go: make OrderedNamespaceDeletion test serial With OrderedNamespaceDeletion enabled by default, the namespace controller now deletes resources before deleting the namespace itself. At the same time, some existing tests create many resources. When those tests finish around the same time, the namespace controller can become overloaded. As a result, it may take longer to start deleting resources created by this test. Initially, this patch increased the test timeout to account for that delay. However, the test still flaked in 1 out of 10 jobs, which suggests increasing the timeouts isn't enough. Once the test was made serial, no flakes were observed. --- test/e2e/apimachinery/namespace.go | 5 +++-- test/e2e/feature/feature.go | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/e2e/apimachinery/namespace.go b/test/e2e/apimachinery/namespace.go index 7c3910af1f0..4080302f170 100644 --- a/test/e2e/apimachinery/namespace.go +++ b/test/e2e/apimachinery/namespace.go @@ -20,11 +20,12 @@ import ( "context" "encoding/json" "fmt" - "k8s.io/kubernetes/pkg/features" "strings" "sync" "time" + "k8s.io/kubernetes/pkg/features" + v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -481,7 +482,7 @@ var _ = SIGDescribe("OrderedNamespaceDeletion", func() { f := framework.NewDefaultFramework("namespacedeletion") f.NamespacePodSecurityLevel = admissionapi.LevelBaseline - f.It("namespace deletion should delete pod first", feature.OrderedNamespaceDeletion, framework.WithFeatureGate(features.OrderedNamespaceDeletion), func(ctx context.Context) { + f.It("namespace deletion should delete pod first", framework.WithFeatureGate(features.OrderedNamespaceDeletion), framework.WithSerial(), func(ctx context.Context) { ensurePodsAreRemovedFirstInOrderedNamespaceDeletion(ctx, f) }) }) diff --git a/test/e2e/feature/feature.go b/test/e2e/feature/feature.go index 86caa4e5cee..08851b5946a 100644 --- a/test/e2e/feature/feature.go +++ b/test/e2e/feature/feature.go @@ -313,10 +313,6 @@ var ( // Tests aiming to verify oom_score functionality OOMScoreAdj = framework.WithFeature(framework.ValidFeatures.Add("OOMScoreAdj")) - // Owner: sig-api-machinery - // Marks tests that enforce ordered namespace deletion. - OrderedNamespaceDeletion = framework.WithFeature(framework.ValidFeatures.Add("OrderedNamespaceDeletion")) - // Owner: sig-node // Verify ProcMount feature. // Used in combination with user namespaces