Skip to content

Commit

Permalink
test(spanner): fix backup spanner test failing because of zero sizeBy…
Browse files Browse the repository at this point in the history
…tes (#5849)

Co-authored-by: Rahul Yadav <irahul@google.com>
  • Loading branch information
rahul2393 and rahul2393 committed Apr 5, 2022
1 parent 3ffdd62 commit 23ea358
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 23ea358

Please sign in to comment.