aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 556 forks source link

test(middleware-sdk-s3): only delete the s3-express bucket created by the test #6077

Closed trivikr closed 1 month ago

trivikr commented 1 month ago

Issue

Internal JS-5161

Description

Deletes only the s3-express bucket created by the test

Testing

Run middleware-s3-express.e2e.spec.ts test 3 times in parallel.

Before

The tests fail, as they try to delete buckets in use by other tests.

$ yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts & yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts & yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts
...
  ● s3 express CRUD test suite › can presign put

    OperationAborted: A conflicting conditional operation is currently in progress against this resource. Please try again.

      4754 |     default:
      4755 |       const parsedBody = parsedOutput.body;
    > 4756 |       return throwDefaultError({
           |              ^
      4757 |         output,
      4758 |         parsedBody,
      4759 |         errorCode
...

After

The tests succeed, as they only delete the bucket created by the test itself.

$ yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts & yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts & yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts
...
Ran all test suites matching /src\/s3-express\/middleware-s3-express.e2e.spec.ts/i.
Done in 9.73s.
[1]  - done       yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts
Done in 9.71s.
[2]  + done       yarn test:e2e src/s3-express/middleware-s3-express.e2e.spec.ts
Done in 9.76s.

Checklist


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

github-actions[bot] commented 1 month ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.