Skip to content

Commit

Permalink
fix(storage): add retry for TestIntegration_DeleteObjectInBucketWithR…
Browse files Browse the repository at this point in the history
…etentionPolicy (#2630)

Closes #1565
  • Loading branch information
Gurov Ilya authored Jul 27, 2020
1 parent a2be9c9 commit bfdc8db
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions storage/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2695,7 +2695,6 @@ func TestIntegration_UpdateRetentionPolicy(t *testing.T) {
}

func TestIntegration_DeleteObjectInBucketWithRetentionPolicy(t *testing.T) {
t.Skip("https://github.com/googleapis/google-cloud-go/issues/1565")
ctx := context.Background()
client := testConfig(ctx, t)
defer client.Close()
Expand All @@ -2714,8 +2713,15 @@ func TestIntegration_DeleteObjectInBucketWithRetentionPolicy(t *testing.T) {
}

// Remove the retention period
h.mustUpdateBucket(bkt, BucketAttrsToUpdate{RetentionPolicy: &RetentionPolicy{RetentionPeriod: 0}})
h.mustDeleteObject(oh)
h.mustUpdateBucket(bkt, BucketAttrsToUpdate{RetentionPolicy: &RetentionPolicy{}})
// Deleting with retry, as bucket metadata changes
// can take some time to propagate.
err := retry(ctx, func() error {
return oh.Delete(ctx)
}, nil)
if err != nil {
h.t.Fatalf("%s: object delete: %v", loc(), err)
}
h.mustDeleteBucket(bkt)
}

Expand Down

0 comments on commit bfdc8db

Please sign in to comment.