Skip to content

Simulate real behaviour of Stream in in-memory implementation of BlobClientΒ #58

@michal-zatloukal

Description

@michal-zatloukal

The in-memory implementation of BlobClient does not require flushing the stream (presumably because it uses InMemoryStream?), which causes a discrepancy where tests pass but the production code fails without an explicit flush. Tests do not reveal this issue.

This code works with the in-memory implementation:

var output = await blobClient.OpenWriteAsync(true, cancellationToken: cancellationToken);
await input.CopyToAsync(output, cancellationToken);

but production code needs this:

var output = await blobClient.OpenWriteAsync(true, cancellationToken: cancellationToken);
await input.CopyToAsync(output, cancellationToken);
await output.FlushAsync();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions