Skip to content

Commit

Permalink
Attempt to make LeafSessionRecording less flaky (#52791)
Browse files Browse the repository at this point in the history
This applies the same measures as #49850 to ensure that nodes are
present and dialable before proceeding with the test.

Fixes #52775.
  • Loading branch information
rosstimothy authored Mar 5, 2025
1 parent fa85bcc commit 5580353
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7520,9 +7520,8 @@ type serviceCfgOpt func(cfg *servicecfg.Config, isRoot bool)
func createTrustedClusterPair(t *testing.T, suite *integrationTestSuite, extraServices func(*testing.T, *helpers.TeleInstance, *helpers.TeleInstance), cfgOpts ...serviceCfgOpt) (*client.TeleportClient, *helpers.TeleInstance, *helpers.TeleInstance) {
ctx := context.Background()
username := suite.Me.Username
name := "test"
rootName := fmt.Sprintf("root-%s", name)
leafName := fmt.Sprintf("leaf-%s", name)
rootName := "root-test"
leafName := "leaf-test"

// Create root and leaf clusters.
rootCfg := helpers.InstanceConfig{
Expand Down Expand Up @@ -7647,6 +7646,14 @@ func createTrustedClusterPair(t *testing.T, suite *integrationTestSuite, extraSe
require.NoError(t, tc.AddTrustedCA(context.Background(), leafCA))
}

// Wait for the nodes to be visible to both Proxy instances.
if root.Config.SSH.Enabled {
require.NoError(t, root.WaitForNodeCount(ctx, rootName, 2))
}
if leaf.Config.SSH.Enabled {
instance := helpers.TeleInstance{Tunnel: leaf.Tunnel}
require.NoError(t, instance.WaitForNodeCount(ctx, leafName, 2))
}
return tc, root, leaf
}

Expand Down

0 comments on commit 5580353

Please sign in to comment.