Skip to content

Commit

Permalink
test(middleware-sdk-s3): increase timeout in E2E test (#5353)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
siddsriv committed Oct 12, 2023
1 parent fc15e05 commit 5a816f9
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand All @@ -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)));
Expand All @@ -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
Expand All @@ -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) {
Expand All @@ -61,7 +62,7 @@ describe("S3 Global Client Test", () => {
await s3Client.deleteObject({ Bucket: bucketName, Key: objKey });
}
}
}, 60000);
});
});

async function deleteBucket(s3: S3, bucketName: string) {
Expand Down

0 comments on commit 5a816f9

Please sign in to comment.