From 5dbd371bd9dea53ec505b2426b1eeb30137acf51 Mon Sep 17 00:00:00 2001 From: Ian Cardoso Date: Mon, 3 Jul 2023 14:35:56 -0300 Subject: [PATCH] fix e2e startup flaky test (#7839) Signed-off-by: Ian Cardoso (cherry picked from commit 324f9ad4daffcfbfb0cec8ddfa96969002e31b4e) --- tests/e2e/startup/startup_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/e2e/startup/startup_test.go b/tests/e2e/startup/startup_test.go index 6dd36acd11b8..89404df3d50a 100644 --- a/tests/e2e/startup/startup_test.go +++ b/tests/e2e/startup/startup_test.go @@ -257,9 +257,12 @@ var _ = Describe("Various Startup Configurations", Ordered, func() { tokenYAML := "token: aaaaaa.bbbbbbbbbbbbbbbb" err := StartK3sCluster(append(serverNodeNames, agentNodeNames...), tokenYAML, tokenYAML) Expect(err).To(HaveOccurred()) - logs, err := e2e.GetJournalLogs(serverNodeNames[0]) - Expect(err).NotTo(HaveOccurred()) - Expect(logs).To(ContainSubstring("failed to normalize server token")) + Eventually(func(g Gomega) { + logs, err := e2e.GetJournalLogs(serverNodeNames[0]) + g.Expect(err).NotTo(HaveOccurred()) + g.Expect(logs).To(ContainSubstring("failed to normalize server token")) + }, "120s", "5s").Should(Succeed()) + }) It("Kills the cluster", func() { err := KillK3sCluster(append(serverNodeNames, agentNodeNames...))