-
Notifications
You must be signed in to change notification settings - Fork 540
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
fix: fix timeout in aws resource detector #2186
Conversation
Current timeout is 1 sec, which is causing EC2 metadata api request timed out. Increase the timeout to 5 sec.
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the timeouts
There was a problem hiding this 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?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2186 +/- ##
==========================================
- Coverage 90.97% 90.40% -0.58%
==========================================
Files 146 149 +3
Lines 7492 7514 +22
Branches 1502 1573 +71
==========================================
- Hits 6816 6793 -23
- Misses 676 721 +45
|
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.