From f3e5f04289bb9282a7590d44e96d336456756159 Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Fri, 10 Jan 2025 08:38:27 -0500 Subject: [PATCH] Fix flaky host user tests (#50918) 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 2f7a741e513f5..0aec29697deaa 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)