Skip to content

Commit 4bbb2af

Browse files
committed
CLDSRV-992: Build the uploadPartCopy fixtures once per suite, not per test
Both `uploadPartCopy` describes in the PartNumber tests rebuild a large MPU fixture in a beforeEach, although all four of their tests only issue a GetObject. Each rebuild moves roughly 200 MB: completeMPU uploads ten 5 MB parts one at a time with async.eachSeries, createMPUAndPutTwoParts copies that 50 MB object and then puts a 50 MB body, and the overwrite variant adds a 5 MB part and a second 50 MB UploadPartCopy. Doing that twice per describe, once for each read-only test, is what pushes the hook past the 40 s mocha timeout on the s3c backend. Move the setup to `before` and the DeleteObject cleanup to `after`. The fixture is identical for both tests in each describe, and the enclosing describe creates the bucket in its own `before` and drops it in `after`, so the fixture safely outlives the individual tests. Halves the data moved by these two describes and removes the redundant rebuild, rather than raising the timeout. Clears the timeout half of CLDSRV-992 row F8 (run 33647777908): the "before each" hook for "should retrieve a part that overwrote another part originally copied from an MPU". The same row's ServiceUnavailable on "should get the body of part 8 when ordered MPU" is a separate transient and is not addressed here. Issue: CLDSRV-992
1 parent ce53804 commit 4bbb2af

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • tests/functional/aws-node-sdk/test/object

tests/functional/aws-node-sdk/test/object/get.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ describe('GET object', () => {
923923
const partOneBody = Buffer.concat(bufs, partOneSize);
924924
const partTwoBody = Buffer.alloc(partSize, 4);
925925

926-
beforeEach(done => async.waterfall([
926+
before(done => async.waterfall([
927927
next => completeMPU(orderedPartNumbers, next),
928928
next => createMPUAndPutTwoParts(partTwoBody, next),
929929
(uploadId, ETags, next) =>
@@ -946,7 +946,7 @@ describe('GET object', () => {
946946
}, next),
947947
], done));
948948

949-
afterEach(done => s3.deleteObject({
949+
after(done => s3.deleteObject({
950950
Bucket: bucketName,
951951
Key: copyPartKey,
952952
}, done));
@@ -968,7 +968,7 @@ describe('GET object', () => {
968968
Buffer.alloc(partSize, n));
969969
const partTwoBody = Buffer.concat(bufs, partTwoSize);
970970

971-
beforeEach(done => async.waterfall([
971+
before(done => async.waterfall([
972972
next => completeMPU(orderedPartNumbers, next),
973973
next => createMPUAndPutTwoParts(partTwoBody, next),
974974
/* eslint-disable no-param-reassign */
@@ -1019,7 +1019,7 @@ describe('GET object', () => {
10191019
}, next),
10201020
], done));
10211021

1022-
afterEach(done => s3.deleteObject({
1022+
after(done => s3.deleteObject({
10231023
Bucket: bucketName,
10241024
Key: copyPartKey,
10251025
}, done));

0 commit comments

Comments
 (0)