From c16cf23d2d0bc68edcf87f84638747314c6178c5 Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Wed, 4 Sep 2024 15:47:59 +0300 Subject: [PATCH] Try to fix the flaky envtest --- .../cassandra/cassandradatacenter_controller_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/controllers/cassandra/cassandradatacenter_controller_test.go b/internal/controllers/cassandra/cassandradatacenter_controller_test.go index 2b0fe192..f172a7c2 100644 --- a/internal/controllers/cassandra/cassandradatacenter_controller_test.go +++ b/internal/controllers/cassandra/cassandradatacenter_controller_test.go @@ -155,8 +155,9 @@ var _ = Describe("CassandraDatacenter tests", func() { refreshDatacenter(ctx, &dc) By("Updating the size to 3") + patch := client.MergeFrom(dc.DeepCopy()) dc.Spec.Size = 3 - Expect(k8sClient.Update(ctx, &dc)).To(Succeed()) + Expect(k8sClient.Patch(ctx, &dc, patch)).To(Succeed()) waitForDatacenterCondition(ctx, dcName, cassdcapi.DatacenterScalingUp, corev1.ConditionTrue).Should(Succeed()) waitForDatacenterProgress(ctx, dcName, cassdcapi.ProgressUpdating).Should(Succeed())