Skip to content

Commit

Permalink
Add support for large append blob
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaZhu committed May 5, 2023
1 parent 43b51ee commit fddc0e7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions sdk/storage/storage-blob/test/node/appendblobclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ describe("AppendBlobClient Node.js only", () => {
let recorder: Recorder;

let blobServiceClient: BlobServiceClient;
const timeoutForLargeFileUploadingTest = 20 * 60 * 1000;

beforeEach(async function (this: Context) {
recorder = record(this, recorderEnvSetup);
blobServiceClient = getBSU();
Expand Down Expand Up @@ -323,4 +325,20 @@ describe("AppendBlobClient Node.js only", () => {
assert.equal(await bodyToString(downloadResponse, content.length * 2), content + content);
assert.equal(downloadResponse.contentLength!, content.length * 2);
});

it("appendBlock - append large block", async () => {
recorder.skip("node", "Recorder file larger than github limitation");
await appendBlobClient.create();

const largeBlockSize = 100 * 1024 * 1024;
const content = new Uint8Array(largeBlockSize);
for (let i = 0; i < largeBlockSize; i = i + 1000) {
content[i] = i;
}
await appendBlobClient.appendBlock(content, content.length);

const downloadResponse = await appendBlobClient.downloadToBuffer(0);
assert.deepStrictEqual(downloadResponse, content);
assert.equal(downloadResponse.length, content.length);
}).timeout(timeoutForLargeFileUploadingTest);
});

0 comments on commit fddc0e7

Please sign in to comment.