From 49f10a3bf9979f3ebbc727c4ab81cb3a480fbcdf Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Wed, 20 Oct 2021 16:34:04 +0200 Subject: [PATCH] Ramp up timeout when calling k8s api to get RabbitMQCluster resource. Also provided a description of asserted generation values to help troubleshoot when it occurs. --- system_tests/system_test.go | 9 +++++---- system_tests/utils.go | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/system_tests/system_test.go b/system_tests/system_test.go index 18107a922..bdd4495c4 100644 --- a/system_tests/system_test.go +++ b/system_tests/system_test.go @@ -66,7 +66,7 @@ var _ = Describe("Operator", func() { Expect(rmqClusterClient.Delete(context.TODO(), cluster)).To(Succeed()) }) - It("works", func() { + FIt("works", func() { By("publishing and consuming a message", func() { response := alivenessTest(hostname, port, username, password) Expect(response.Status).To(Equal("ok")) @@ -115,7 +115,8 @@ var _ = Describe("Operator", func() { Eventually(func() bool { Expect(rmqClusterClient.Get(ctx, types.NamespacedName{Name: cluster.Name, Namespace: cluster.Namespace}, fetchedRmq)).To(Succeed()) return fetchedRmq.Status.ObservedGeneration == fetchedRmq.Generation - }, 30).Should(BeTrue()) + }, k8sQueryTimeout, 10).Should(BeTrue(), fmt.Sprintf("expected %d (Status.ObservedGeneration) = %d (Generation)", + fetchedRmq.Status.ObservedGeneration, fetchedRmq.Generation)) }) By("having all feature flags enabled", func() { @@ -151,7 +152,7 @@ var _ = Describe("Operator", func() { Expect(rmqClusterClient.Delete(context.TODO(), cluster)).To(Succeed()) }) - FIt("keeps rabbitmq server related configurations up-to-date", func() { + It("keeps rabbitmq server related configurations up-to-date", func() { By("updating enabled plugins and the secret ports when additionalPlugins are modified", func() { // modify rabbitmqcluster.spec.rabbitmq.additionalPlugins Expect(updateRabbitmqCluster(ctx, rmqClusterClient, cluster.Name, cluster.Namespace, func(cluster *rabbitmqv1beta1.RabbitmqCluster) { @@ -329,7 +330,7 @@ CONSOLE_LOG=new` waitForRabbitmqRunning(cluster) }) - It("allows volume expansion", func() { + FIt("allows volume expansion", func() { podUID := pod(ctx, clientSet, cluster, 0).UID output, err := kubectlExec(namespace, statefulSetPodName(cluster, 0), "rabbitmq", "df", "/var/lib/rabbitmq/mnesia") Expect(err).ToNot(HaveOccurred()) diff --git a/system_tests/utils.go b/system_tests/utils.go index 2ccaca2f8..8035e0112 100644 --- a/system_tests/utils.go +++ b/system_tests/utils.go @@ -59,7 +59,8 @@ import ( ) const podCreationTimeout = 10 * time.Minute -const portReadinessTimeout = 10 * time.Second +const portReadinessTimeout = 1 * time.Minute +const k8sQueryTimeout = 1 * time.Minute type featureFlag struct { Name string