diff --git a/spanner/integration_test.go b/spanner/integration_test.go index 48402b703c2..d0f3755ecdb 100644 --- a/spanner/integration_test.go +++ b/spanner/integration_test.go @@ -3490,9 +3490,17 @@ func TestIntegration_StartBackupOperation(t *testing.T) { // 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, statements[testDialect][backupDDLStatements]) + client, testDatabaseName, cleanup := prepareIntegrationTest(ctx, t, DefaultSessionPoolConfig, statements[testDialect][backupDDLStatements]) defer cleanup() + // Set up 1 singer to have backup size greater than zero + singers := []*Mutation{ + Insert("Singers", []string{"SingerId", "FirstName", "LastName"}, []interface{}{int64(1), "test", "test"}), + } + if _, err := client.Apply(ctx, singers, ApplyAtLeastOnce()); err != nil { + t.Fatal(err) + } + backupID := backupIDSpace.New() backupName := fmt.Sprintf("projects/%s/instances/%s/backups/%s", testProjectID, testInstanceID, backupID) // Minimum expiry time is 6 hours