Skip to content

Commit 6d9d021

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 CLDSRV-992 row F4 (run 33630581671) and the timeout half of row F8 (run 33647777908, fixed for the 9.2 line separately). Issue: CLDSRV-992
1 parent 4628dd2 commit 6d9d021

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
@@ -908,7 +908,7 @@ describe('GET object', () => {
908908
const partOneBody = Buffer.concat(bufs, partOneSize);
909909
const partTwoBody = Buffer.alloc(partSize, 4);
910910

911-
beforeEach(done => async.waterfall([
911+
before(done => async.waterfall([
912912
next => completeMPU(orderedPartNumbers, next),
913913
next => createMPUAndPutTwoParts(partTwoBody, next),
914914
(uploadId, ETags, next) =>
@@ -931,7 +931,7 @@ describe('GET object', () => {
931931
})).then(() => next()).catch(next),
932932
], done));
933933

934-
afterEach(async () => {
934+
after(async () => {
935935
await s3.send(new DeleteObjectCommand({
936936
Bucket: bucketName,
937937
Key: copyPartKey,
@@ -955,7 +955,7 @@ describe('GET object', () => {
955955
Buffer.alloc(partSize, n));
956956
const partTwoBody = Buffer.concat(bufs, partTwoSize);
957957

958-
beforeEach(done => async.waterfall([
958+
before(done => async.waterfall([
959959
next => completeMPU(orderedPartNumbers, next),
960960
next => createMPUAndPutTwoParts(partTwoBody, next),
961961
/* eslint-disable no-param-reassign */
@@ -1004,7 +1004,7 @@ describe('GET object', () => {
10041004
})).then(() => next()).catch(next),
10051005
], done));
10061006

1007-
afterEach(async () => {
1007+
after(async () => {
10081008
await s3.send(new DeleteObjectCommand({
10091009
Bucket: bucketName,
10101010
Key: copyPartKey,

0 commit comments

Comments
 (0)