Skip to content

Commit

Permalink
test(storage): unflake TestIntegration_ACL
Browse files Browse the repository at this point in the history
I realized that this section had been slightly messed up in
the integration test refactor for retries; we need the object
creation to be retried as well if the check fails.

Also removed superfluous unused object name.

Fixes googleapis#6579
  • Loading branch information
tritone committed Sep 9, 2022
1 parent 3dafcbc commit f220da4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions storage/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2352,19 +2352,15 @@ func TestIntegration_ACL(t *testing.T) {
} else if !hasRule(acl, rule) {
t.Errorf("default ACL missing %#v", rule)
}
aclObjects := []string{"acl1", "acl2"}
name := aclObjects[0]
name := "acl1"
o := bkt.Object(name)

for _, obj := range aclObjects {
c := randomContents()
if err := writeObject(ctx, bkt.Object(obj).If(Conditions{DoesNotExist: true}), "", c); err != nil {
t.Errorf("Write for %v failed with %v", obj, err)
}
}
c := randomContents()

// Retry to account for propagation delay in metadata update.
err = retry(ctx, func() error {
if err := writeObject(ctx, o, "", c); err != nil {
return fmt.Errorf("Write for %v failed with %v", name, err)
}
acl, err = o.ACL().List(ctx)
return err
}, func() error {
Expand Down

0 comments on commit f220da4

Please sign in to comment.