Skip to content

Commit

Permalink
test(storage): unflake PublicAccessPrevention test (#4352)
Browse files Browse the repository at this point in the history
This needs a retry to account for propagation time for bucket
ACLs.

Fixes #4351
  • Loading branch information
tritone authored Jul 1, 2021
1 parent 7aa0e19 commit 58d4055
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions storage/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,14 @@ func TestIntegration_PublicAccessPrevention(t *testing.T) {
t.Error("updating PublicAccessPrevention changed UBLA setting")
}

// Now, making object public or making bucket public should succeed.
a = o.ACL()
if err := a.Set(ctx, AllUsers, RoleReader); err != nil {
// Now, making object public or making bucket public should succeed. Run with
// retry because ACL settings may take time to propagate.
if err := retry(ctx,
func() error {
a = o.ACL()
return a.Set(ctx, AllUsers, RoleReader)
},
nil); err != nil {
t.Errorf("ACL.Set: making object public failed: %v", err)
}
policy, err = bkt.IAM().V3().Policy(ctx)
Expand Down

0 comments on commit 58d4055

Please sign in to comment.