aws / aws-sdk-js-v3

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

fix(ec2-metadata-service): set timeout for requests #6072

Closed siddsriv closed 1 month ago

siddsriv commented 1 month ago

Issue

6042

Description

set the timeout for requests to ec2-mds.

Testing

E2E tests for the package pass.


 PASS  src/MetadataService.e2e.spec.ts
  MetadataService E2E Tests
    ✓ should fetch metadata token successfully (6 ms)
    ✓ should fetch metadata successfully with token (4 ms)
    ✓ should fetch metadata successfully (without token -- disableFetchToken set to true) (2 ms)
    ✓ should handle TimeoutError by falling back to IMDSv1 (3 ms)
    ✓ should handle specific error codes by falling back to IMDSv1 (6 ms)
    ✓ should timeout as expected when a request exceeds the specified duration (4 ms)

Test Suites: 1 passed, 1 total
Tests:       6 passed, 6 total
Snapshots:   0 total
Time:        3.358 s, estimated 4 s
Ran all test suites.
Done in 4.34s.

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.