Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix timeout in aws resource detector #2186

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

arunp0
Copy link

@arunp0 arunp0 commented May 8, 2024

Current timeout is 1 sec, which is causing EC2 metadata api request timed out

Which problem is this PR solving?

The current Ec2 metadata API timeout is 1 sec, which is causing frequent "EC2 metadata API request timed out" issues.

Short description of the changes

Increased the metadata API timeout to 5 sec.

Current timeout is 1 sec, which is causing EC2 metadata api request timed out.
Increase the timeout to 5 sec.
@arunp0 arunp0 requested a review from a team as a code owner May 8, 2024 13:28
Copy link

linux-foundation-easycla bot commented May 8, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@@ -109,7 +109,8 @@ describe('awsEc2Detector', () => {
scope.done();
});

it('should throw when timed out', async () => {
it('should throw when timed out', function (done) {
this.timeout(7000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're changing the timeout value for the test, you're not really testing the new value you changed to. Don't you want to test with the 5s?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the timeouts

Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I wonder - can it practically take this much time for the endpoint to respond? shouldn't it be a localhost call?

Copy link

codecov bot commented May 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.38%. Comparing base (dfb2dff) to head (5b4c89c).
Report is 148 commits behind head on main.

Current head 5b4c89c differs from pull request most recent head 8363984

Please upload reports for the commit 8363984 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2186      +/-   ##
==========================================
- Coverage   90.97%   90.38%   -0.60%     
==========================================
  Files         146      148       +2     
  Lines        7492     7509      +17     
  Branches     1502     1573      +71     
==========================================
- Hits         6816     6787      -29     
- Misses        676      722      +46     
Files Coverage Δ
...ource-detector-aws/src/detectors/AwsEc2Detector.ts 97.91% <ø> (ø)

... and 44 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants