From 5a816f9457e3d7f67c1352fb561414774e10559c Mon Sep 17 00:00:00 2001 From: Siddharth Srivastava <48153483+siddsriv@users.noreply.github.com> Date: Thu, 12 Oct 2023 16:11:20 -0400 Subject: [PATCH] test(middleware-sdk-s3): increase timeout in E2E test (#5353) * test(middleware-sdk-s3): increase timeout in E2E test * test(middleware-sdk-s3): move timeout to top of file * test(middleware-sdk-s3): remove redundant timeouts for each case --- .../src/region-redirect-middleware.e2e.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts b/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts index 7c075f61680d3..2af4c3f44500d 100644 --- a/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts +++ b/packages/middleware-sdk-s3/src/region-redirect-middleware.e2e.spec.ts @@ -1,6 +1,8 @@ import { S3 } from "@aws-sdk/client-s3"; import { GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; +jest.setTimeout(100000); + const testValue = "Hello S3 global client!"; describe("S3 Global Client Test", () => { @@ -21,7 +23,6 @@ describe("S3 Global Client Test", () => { const randId = alphabet[(Math.random() * alphabet.length) | 0] + alphabet[(Math.random() * alphabet.length) | 0]; beforeAll(async () => { - jest.setTimeout(60000); callerID = await stsClient.getCallerIdentity({}); bucketNames = regionConfigs.map((config) => `${callerID.Account}-${randId}-redirect-${config.region}`); await Promise.all(bucketNames.map((bucketName, index) => deleteBucket(s3Clients[index], bucketName))); @@ -40,7 +41,7 @@ describe("S3 Global Client Test", () => { await s3Client.putObject({ Bucket: bucketName, Key: objKey, Body: testValue }); } } - }, 60000); + }); it("Should be able to get objects following region redirect", async () => { // Fetch and assert objects @@ -52,7 +53,7 @@ describe("S3 Global Client Test", () => { expect(data).toEqual(testValue); } } - }, 60000); + }); it("Should delete objects following region redirect", async () => { for (const bucketName of bucketNames) { @@ -61,7 +62,7 @@ describe("S3 Global Client Test", () => { await s3Client.deleteObject({ Bucket: bucketName, Key: objKey }); } } - }, 60000); + }); }); async function deleteBucket(s3: S3, bucketName: string) {