Skip to content

Commit

Permalink
test(storage): fix flaky soft delete update (#11366)
Browse files Browse the repository at this point in the history
Fixes #10761
  • Loading branch information
BrennaEpp authored Jan 4, 2025
1 parent 4fb6ad9 commit 391e254
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions storage/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4618,14 4618,18 @@ func TestIntegration_SoftDelete(t *testing.T) {
// Update the soft delete policy of the original bucket.
policy.RetentionDuration = time.Hour * 24 * 9

attrs, err = b.Update(ctx, BucketAttrsToUpdate{SoftDeletePolicy: policy})
if err != nil {
t.Fatalf("b.Update: %v", err)
}

if got, expect := attrs.SoftDeletePolicy.RetentionDuration, policy.RetentionDuration; got != expect {
t.Fatalf("mismatching retention duration; got: % v, expected: % v", got, expect)
}
retry(ctx, func() error {
attrs, err = b.Update(ctx, BucketAttrsToUpdate{SoftDeletePolicy: policy})
if err != nil {
return fmt.Errorf("b.Update: %v", err)
}
return nil
}, func() error {
if got, expect := attrs.SoftDeletePolicy.RetentionDuration, policy.RetentionDuration; got != expect {
return fmt.Errorf("mismatching retention duration; got: % v, expected: % v", got, expect)
}
return nil
})

// Create 2 objects and delete one of them.
deletedObject := b.Object("soft-delete" uidSpaceObjects.New())
Expand Down

0 comments on commit 391e254

Please sign in to comment.