storage: unflake TestIntegration_WriterContentType
Add a retry to all calls to the writeObject method (used by
multiple integration tests). After we finish related work on
improving retries in the client for write operations, this
can probably be removed.
Fixes
@@ -3391,6 +3391,9 @@ func (h testHelper) mustNewReader(obj *ObjectHandle) *Reader {
}
func writeObject(ctx context.Context, obj *ObjectHandle, contentType string, contents []byte) error {
+ // TODO: remove retry once retry logic in the client has been improved.
+ // https://github.com/googleapis/google-cloud-go/issues/2395
+ return retry(ctx, func() error {
w := obj.NewWriter(ctx)
w.ContentType = contentType
w.CacheControl = "public, max-age=60"
@@ -3401,6 +3404,7 @@ func writeObject(ctx context.Context, obj *ObjectHandle, contentType string, con
}
}
return w.Close()
+ }, nil)
}
// loc returns a string describing the file and line of its caller's call site. In
