Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,24 @@ describe("S3 Expires e2e test", () => {
let callerID = null as unknown as GetCallerIdentityCommandOutput;
let Bucket: string;

// random element limited to 2 letters to avoid concurrent IO, and
// to limit bucket count to 676 if there is failure to delete them.
const alphabet = "abcdefghijklmnopqrstuvwxyz";
const randId = alphabet[(Math.random() * alphabet.length) | 0] + alphabet[(Math.random() * alphabet.length) | 0];
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
const char = () => alphabet[(Math.random() * alphabet.length) | 0];
const randId = char() + char() + char() + char() + (Date.now() % 1000);

beforeAll(async () => {
callerID = await stsClient.getCallerIdentity({});
Bucket = `${callerID.Account}-${randId}-s3-expires`;
await s3.createBucket({
Bucket,
});
Bucket = `${callerID.Account}-s3-expires-${randId}`;

await s3
.createBucket({
Bucket,
})
.catch((e) => {
if (e.name === "BucketAlreadyOwnedByYou") {
return;
}
throw e;
});
});

afterAll(async () => {
Expand Down
Loading