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(spanner): fix backup spanner test failing because of zero sizeBytes #5849

Merged
merged 1 commit into from Apr 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion spanner/integration_test.go
Expand Up @@ -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
Expand Down