From 6baf3eb05cdc8a1a2746c73c4aa7bd815ec7d72d Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Thu, 9 Sep 2021 10:44:49 +0200 Subject: [PATCH] Fix flaky TestGetWorkloadCluster test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- controlplane/kubeadm/internal/cluster_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controlplane/kubeadm/internal/cluster_test.go b/controlplane/kubeadm/internal/cluster_test.go index 18b665b42384..2f0f893e851a 100644 --- a/controlplane/kubeadm/internal/cluster_test.go +++ b/controlplane/kubeadm/internal/cluster_test.go @@ -192,8 +192,10 @@ func TestGetWorkloadCluster(t *testing.T) { }(o) } + // Note: The API reader is intentionally used instead of the regular (cached) client + // to avoid test failures when the local cache isn't able to catch up in time. m := Management{ - Client: env, + Client: env.GetAPIReader(), Tracker: tracker, }