diff --git a/storage/grpc_client.go b/storage/grpc_client.go index dd44d7d073b1..88ea7e561de3 100644 --- a/storage/grpc_client.go +++ b/storage/grpc_client.go @@ -1060,11 +1060,13 @@ func (c *grpcStorageClient) OpenWriter(params *openWriterParams, opts ...storage pr.CloseWithError(err) return } - // At this point, the current buffer has been uploaded. Capture the - // committed offset here in case the upload was not finalized and - // another chunk is to be uploaded. - offset = off - progress(offset) + // At this point, the current buffer has been uploaded. For resumable + // uploads, capture the committed offset here in case the upload was not + // finalized and another chunk is to be uploaded. + if gw.upid != "" { + offset = off + progress(offset) + } // When we are done reading data and the chunk has been finalized, // we are done. diff --git a/storage/integration_test.go b/storage/integration_test.go index 76b318fded26..b87ccd72a1cc 100644 --- a/storage/integration_test.go +++ b/storage/integration_test.go @@ -2251,7 +2251,7 @@ func TestIntegration_WriterContentType(t *testing.T) { } func TestIntegration_WriterChunksize(t *testing.T) { - ctx := skipJSONReads(skipGRPC("https://github.com/googleapis/google-cloud-go/issues/7839"), "no reads in test") + ctx := skipJSONReads(context.Background(), "no reads in test") multiTransportTest(ctx, t, func(t *testing.T, ctx context.Context, bucket, _ string, client *Client) { obj := client.Bucket(bucket).Object("writer-chunksize-test" + uidSpaceObjects.New()) objSize := 1<<10<<10 + 1 // 1 Mib + 1 byte