From a81a21214625b7503e1b5c06922cefe622036892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20de=20Sousa-Valadas=20Casta=C3=B1o?= Date: Wed, 21 Dec 2022 01:51:12 +0100 Subject: [PATCH] Fix the test custom-domain flakyness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test custom-domain has become flaky. I'm not quite sure when did this happen, but it was recently. We can see in many executions such as: https://github.com/k0sproject/k0s/actions/runs/3742332086/jobs/6359020341 https://github.com/k0sproject/k0s/actions/runs/3740780796/jobs/6349616080 https://github.com/k0sproject/k0s/actions/runs/3731323166/attempts/2 We can solve this simply by waiting for pod logs as this guarantees that konnectivity is actually working. It's worth noting that if there were more controllers waiting for pod logs wouldn't be 100% reliable. Signed-off-by: Juan Luis de Sousa-Valadas CastaƱo --- inttest/customdomain/customdomain_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/inttest/customdomain/customdomain_test.go b/inttest/customdomain/customdomain_test.go index 32d057053d8e..fb566e6388c4 100644 --- a/inttest/customdomain/customdomain_test.go +++ b/inttest/customdomain/customdomain_test.go @@ -57,6 +57,7 @@ func (s *CustomDomainSuite) TestK0sGetsUpWithCustomDomain() { _, err = ssh.ExecWithOutput(s.Context(), "/usr/local/bin/k0s kc run nginx --image docker.io/nginx:1-alpine") s.Require().NoError(err) s.NoError(common.WaitForPod(s.Context(), kc, "nginx", "default")) + s.NoError(common.WaitForPodLogs(s.Context(), kc, "default")) output, err := ssh.ExecWithOutput(s.Context(), "/usr/local/bin/k0s kc exec nginx -- cat /etc/resolv.conf") s.Require().NoError(err) s.Contains(output, "search default.svc.something.local svc.something.local something.local")