fix(storage): add retryalways policy to encryption test (#10644) · googleapis/google-cloud-go@59cfd12

@@ -2711,7 +2711,7 @@ func TestIntegration_Encryption(t *testing.T) {

27112711

multiTransportTest(context.Background(), t, func(t *testing.T, ctx context.Context, bucket, _ string, client *Client) {

27122712

h := testHelper{t}

271327132714-

obj := client.Bucket(bucket).Object("customer-encryption")

2714+

obj := client.Bucket(bucket).Object("customer-encryption").Retryer(WithPolicy(RetryAlways))

27152715

key := []byte("my-secret-AES-256-encryption-key")

27162716

keyHash := sha256.Sum256(key)

27172717

keyHashB64 := base64.StdEncoding.EncodeToString(keyHash[:])

@@ -2791,8 +2791,8 @@ func TestIntegration_Encryption(t *testing.T) {

2791279127922792

// We create 2 objects here and we can interleave operations to get around

27932793

// the rate limit for object mutation operations (create, update, and delete).

2794-

obj2 := client.Bucket(bucket).Object("customer-encryption-2")

2795-

obj4 := client.Bucket(bucket).Object("customer-encryption-4")

2794+

obj2 := client.Bucket(bucket).Object("customer-encryption-2").Retryer(WithPolicy(RetryAlways))

2795+

obj4 := client.Bucket(bucket).Object("customer-encryption-4").Retryer(WithPolicy(RetryAlways))

2796279627972797

// Copying an object without the key should fail.

27982798

if _, err := obj4.CopierFrom(obj).Run(ctx); err == nil {

@@ -2825,7 +2825,7 @@ func TestIntegration_Encryption(t *testing.T) {

28252825

if _, err := obj2.Key(key).CopierFrom(obj2.Key(key2)).Run(ctx); err != nil {

28262826

t.Fatal(err)

28272827

}

2828-

obj3 := client.Bucket(bucket).Object("customer-encryption-3")

2828+

obj3 := client.Bucket(bucket).Object("customer-encryption-3").Retryer(WithPolicy(RetryAlways))

28292829

// Composing without keys should fail.

28302830

if _, err := obj3.ComposerFrom(obj, obj2).Run(ctx); err == nil {

28312831

t.Fatal("want error, got nil")

@@ -2846,7 +2846,7 @@ func TestIntegration_Encryption(t *testing.T) {

28462846

// encrypted destination object.

28472847

_, err := obj4.CopierFrom(obj2.Key(key)).Run(ctx) // unencrypt obj2

28482848

if err != nil {

2849-

t.Fatal(err)

2849+

t.Fatalf("Copier.Run: %v", err)

28502850

}

28512851

if _, err := obj3.Key(key).ComposerFrom(obj4).Run(ctx); err == nil {

28522852

t.Fatal("got nil, want error")