From c3127f129ff2e36cea1aeb9aac51c5a0772a8aad Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Wed, 20 Nov 2024 14:31:00 +0530 Subject: [PATCH 1/3] address malformed configmap post-test --- test/extended/prometheus/collection_profiles.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/extended/prometheus/collection_profiles.go b/test/extended/prometheus/collection_profiles.go index 2b14475cb211..19545f7bb4de 100644 --- a/test/extended/prometheus/collection_profiles.go +++ b/test/extended/prometheus/collection_profiles.go @@ -84,14 +84,12 @@ var _ = g.Describe("[sig-instrumentation][OCPFeatureGate:MetricsCollectionProfil if err != nil { if errors.IsNotFound(err) { g.By("initially, creating a configuration for the operator as it did not exist") + operatorConfiguration = nil err = r.makeCollectionProfileConfigurationFor(tctx, collectionProfileDefault) } - if err != nil { - return err - } } - return nil + return err }).Should(o.BeNil()) r.originalOperatorConfiguration = operatorConfiguration }) @@ -108,6 +106,14 @@ var _ = g.Describe("[sig-instrumentation][OCPFeatureGate:MetricsCollectionProfil err = r.kclient.CoreV1().ConfigMaps(operatorNamespaceName).Delete(tctx, operatorConfigurationName, metav1.DeleteOptions{}) } o.Expect(err).To(o.BeNil()) + + o.Eventually(func() error { + _, err := r.kclient.CoreV1().ConfigMaps(operatorNamespaceName).Get(tctx, operatorConfigurationName, metav1.GetOptions{}) + if errors.IsNotFound(err) { + return nil + } + return fmt.Errorf("ConfigMap %q still exists after deletion attempt", operatorConfigurationName) + }).Should(o.BeNil()) }) g.Context("initially, in a homogeneous default environment,", func() { From 0967191ec6dd9dabcd5b0bfc2ffa6fc97b31e6e9 Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Wed, 20 Nov 2024 16:39:59 +0530 Subject: [PATCH 2/3] fixup! address malformed configmap post-test --- test/extended/prometheus/collection_profiles.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/extended/prometheus/collection_profiles.go b/test/extended/prometheus/collection_profiles.go index 19545f7bb4de..4f5ef3008b6f 100644 --- a/test/extended/prometheus/collection_profiles.go +++ b/test/extended/prometheus/collection_profiles.go @@ -85,11 +85,13 @@ var _ = g.Describe("[sig-instrumentation][OCPFeatureGate:MetricsCollectionProfil if errors.IsNotFound(err) { g.By("initially, creating a configuration for the operator as it did not exist") operatorConfiguration = nil - err = r.makeCollectionProfileConfigurationFor(tctx, collectionProfileDefault) + return r.makeCollectionProfileConfigurationFor(tctx, collectionProfileDefault) } + + return err } - return err + return nil }).Should(o.BeNil()) r.originalOperatorConfiguration = operatorConfiguration }) From c4c4e96e8216e5bf7df5a6ba982f1bdf5f3d8afb Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Wed, 20 Nov 2024 18:30:28 +0530 Subject: [PATCH 3/3] fixup! fixup! address malformed configmap post-test Signed-off-by: Pranshu Srivastava --- test/extended/prometheus/collection_profiles.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/extended/prometheus/collection_profiles.go b/test/extended/prometheus/collection_profiles.go index 4f5ef3008b6f..09442a13f5e2 100644 --- a/test/extended/prometheus/collection_profiles.go +++ b/test/extended/prometheus/collection_profiles.go @@ -58,7 +58,7 @@ type runner struct { var _ = g.Describe("[sig-instrumentation][OCPFeatureGate:MetricsCollectionProfiles] The collection profiles feature-set", g.Ordered, func() { defer g.GinkgoRecover() - o.SetDefaultEventuallyTimeout(15 * time.Minute) + o.SetDefaultEventuallyTimeout(20 * time.Minute) o.SetDefaultEventuallyPollingInterval(5 * time.Second) r := &runner{}