From fa1f2688cdd186a64df84ead799096bb5f7e7953 Mon Sep 17 00:00:00 2001 From: Tim Ross Date: Thu, 9 Jan 2025 11:19:24 -0500 Subject: [PATCH] Fix flaky host user tests 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 b5b045c2840b3..b7ae314a0a834 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)