Skip to content

Flaky test fix TestCanGetKeyspaces #16214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions go/cmd/vttestserver/cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ func TestCanGetKeyspaces(t *testing.T) {
conf := config
defer resetConfig(conf)

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

clusterInstance, err := startCluster()
require.NoError(t, err)
defer clusterInstance.TearDown()
Expand All @@ -251,16 +248,15 @@ func TestCanGetKeyspaces(t *testing.T) {
}
}()

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
assertGetKeyspaces(ctx, t, clusterInstance)
}

func TestExternalTopoServerConsul(t *testing.T) {
conf := config
defer resetConfig(conf)

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

// Start a single consul in the background.
cmd, serverAddr := startConsul(t)
defer func() {
Expand All @@ -279,6 +275,8 @@ func TestExternalTopoServerConsul(t *testing.T) {
require.NoError(t, err)
defer cluster.TearDown()

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
assertGetKeyspaces(ctx, t, cluster)
}

Expand Down
Loading