From 021f20adb3b15b79660b19e7474d9713c515a3fb Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:23:38 -0500 Subject: [PATCH] Fix flaky host user tests (#50911) Applies the same fixes as #49850 to ensure that the tests wait until the target host is routable before attempting to create any SSH sessions. Closes https://github.com/gravitational/teleport/issues/50910 --- integration/hostuser_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration/hostuser_test.go b/integration/hostuser_test.go index f917a95f872a5..02145bc38274e 100644 --- a/integration/hostuser_test.go +++ b/integration/hostuser_test.go @@ -667,6 +667,8 @@ func TestRootLoginAsHostUser(t *testing.T) { require.NoError(t, instance.StopAll()) }) + instance.WaitForNodeCount(context.Background(), helpers.Site, 1) + tests := []struct { name string command []string @@ -750,6 +752,8 @@ func TestRootStaticHostUsers(t *testing.T) { _, err = instance.StartNode(nodeCfg) require.NoError(t, err) + instance.WaitForNodeCount(context.Background(), helpers.Site, 2) + // Create host user resources. groups := []string{"foo", "bar"} goodLogin := utils.GenerateLocalUsername(t)