test(spanner): fix flaky TestIntegration_StartBackupOperation test (#4978)
* fix(spanner): fix flaky TestIntegration_StartBackupOperation test
* fix(spanner): fix flaky TestIntegration_StartBackupOperation test
Co-authored-by: Rahul Yadav <irahul@google.com>
diff --git a/spanner/integration_test.go b/spanner/integration_test.go
index 84de686..4cebb06 100644
--- a/spanner/integration_test.go
+++ b/spanner/integration_test.go
@@ -3171,8 +3171,9 @@
skipEmulatorTest(t)
t.Parallel()
- // Backups can be slow, so use a 30 minute timeout.
- ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
+ startTime := time.Now()
+ // Backups can be slow, so use 1 hour timeout.
+ ctx, cancel := context.WithTimeout(context.Background(), 1*time.Hour)
defer cancel()
_, testDatabaseName, cleanup := prepareIntegrationTest(ctx, t, DefaultSessionPoolConfig, backuDBStatements)
defer cleanup()
@@ -3190,6 +3191,7 @@
if err != nil {
t.Fatal(err)
}
+ t.Logf("create backup operation took: %v\n", time.Since(startTime))
respMetadata, err := respLRO.Metadata()
if err != nil {
t.Fatalf("backup response metadata, got error %v, want nil", err)