From 4bbb2af7004615a0568d2cebb4f19d81ed65587c Mon Sep 17 00:00:00 2001 From: Anurag Mittal <1321012+anurag4DSB@users.noreply.github.com> Date: Tue, 8 Sep 2026 08:18:39 +0200 Subject: [PATCH] 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 --- tests/functional/aws-node-sdk/test/object/get.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/functional/aws-node-sdk/test/object/get.js b/tests/functional/aws-node-sdk/test/object/get.js index bb3b0a2e99..88054ccb69 100644 --- a/tests/functional/aws-node-sdk/test/object/get.js +++ b/tests/functional/aws-node-sdk/test/object/get.js @@ -923,7 +923,7 @@ describe('GET object', () => { const partOneBody = Buffer.concat(bufs, partOneSize); const partTwoBody = Buffer.alloc(partSize, 4); - beforeEach(done => async.waterfall([ + before(done => async.waterfall([ next => completeMPU(orderedPartNumbers, next), next => createMPUAndPutTwoParts(partTwoBody, next), (uploadId, ETags, next) => @@ -946,7 +946,7 @@ describe('GET object', () => { }, next), ], done)); - afterEach(done => s3.deleteObject({ + after(done => s3.deleteObject({ Bucket: bucketName, Key: copyPartKey, }, done)); @@ -968,7 +968,7 @@ describe('GET object', () => { Buffer.alloc(partSize, n)); const partTwoBody = Buffer.concat(bufs, partTwoSize); - beforeEach(done => async.waterfall([ + before(done => async.waterfall([ next => completeMPU(orderedPartNumbers, next), next => createMPUAndPutTwoParts(partTwoBody, next), /* eslint-disable no-param-reassign */ @@ -1019,7 +1019,7 @@ describe('GET object', () => { }, next), ], done)); - afterEach(done => s3.deleteObject({ + after(done => s3.deleteObject({ Bucket: bucketName, Key: copyPartKey, }, done));