Skip to content
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

test(bigtable): Cancel context #9273

Merged
merged 4 commits into from
Jan 23, 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
34 changes: 23 additions & 11 deletions bigtable/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,8 @@ func TestIntegration_TableDeletionProtection(t *testing.T) {
if testEnv.Config().UseProd {
timeout = 5 * time.Minute
}
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

adminClient, err := testEnv.NewAdminClient()
if err != nil {
Expand Down Expand Up @@ -1618,7 +1619,8 @@ func TestIntegration_EnableChangeStream(t *testing.T) {
if testEnv.Config().UseProd {
timeout = 5 * time.Minute
}
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

adminClient, err := testEnv.NewAdminClient()
if err != nil {
Expand Down Expand Up @@ -1702,7 +1704,8 @@ func TestIntegration_Admin(t *testing.T) {
if testEnv.Config().UseProd {
timeout = 5 * time.Minute
}
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

adminClient, err := testEnv.NewAdminClient()
if err != nil {
Expand Down Expand Up @@ -1894,7 +1897,8 @@ func TestIntegration_TableIam(t *testing.T) {
}

timeout := 5 * time.Minute
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

adminClient, err := testEnv.NewAdminClient()
if err != nil {
Expand Down Expand Up @@ -1932,7 +1936,8 @@ func TestIntegration_BackupIAM(t *testing.T) {
t.Skip("emulator doesn't support IAM Policy creation")
}
timeout := 5 * time.Minute
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

adminClient, err := testEnv.NewAdminClient()
if err != nil {
Expand Down Expand Up @@ -2006,7 +2011,8 @@ func TestIntegration_AdminCreateInstance(t *testing.T) {
}

timeout := 7 * time.Minute
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

iAdminClient, err := testEnv.NewInstanceAdminClient()
if err != nil {
Expand Down Expand Up @@ -2291,7 +2297,9 @@ func TestIntegration_AdminUpdateInstanceLabels(t *testing.T) {

// Create an instance admin client
timeout := 7 * time.Minute
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

iAdminClient, err := testEnv.NewInstanceAdminClient()
if err != nil {
t.Fatalf("NewInstanceAdminClient: %v", err)
Expand Down Expand Up @@ -2387,7 +2395,8 @@ func TestIntegration_AdminUpdateInstanceAndSyncClusters(t *testing.T) {
}

timeout := 5 * time.Minute
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

iAdminClient, err := testEnv.NewInstanceAdminClient()
if err != nil {
Expand Down Expand Up @@ -2557,7 +2566,8 @@ func TestIntegration_Autoscaling(t *testing.T) {
}

timeout := 5 * time.Minute
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

iAdminClient, err := testEnv.NewInstanceAdminClient()
if err != nil {
Expand Down Expand Up @@ -2725,7 +2735,8 @@ func TestIntegration_Granularity(t *testing.T) {
if testEnv.Config().UseProd {
timeout = 5 * time.Minute
}
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

adminClient, err := testEnv.NewAdminClient()
if err != nil {
Expand Down Expand Up @@ -3231,7 +3242,8 @@ func TestIntegration_AdminBackup(t *testing.T) {
}

timeout := 15 * time.Minute
ctx, _ := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

adminClient, err := testEnv.NewAdminClient()
if err != nil {
Expand Down
Loading