aws / aws-sdk-net

The official AWS SDK for .NET. For more information on the AWS SDK for .NET, see our web site:
http://aws.amazon.com/sdkfornet/
Apache License 2.0
2.03k stars 850 forks source link

AWSSDK.Extensions.NETCore.Setup 3.7.2 causing tests to be extremely slow #2000

Open dannystommen opened 2 years ago

dannystommen commented 2 years ago

Description

we're using AWSSDK.Extensions.NETCore.Setup and since updating it to 3.7.2, running tests became extremely slow in our pipeline. On my local (windows) machine, everything still works as expected. In our pipeline, total time of tests increased from 5 seconds to 130 sec.

Find attached the test results

When looking at all tests, multiple tests take 16 seconds suddenly, like something is being locked. Some tests even take 32 sec. Nothing in between. So a lots of tests complete in milliseconds, a few tests take like 16 sec, and 1 or 2 tests take 32 sec.

Environment


This is a :bug: bug-report test-results.zip

ashishdhingra commented 2 years ago

Hi @dannystommen,

Good afternoon.

Would it be possible to share a sample code solution containing tests that target 3.7.1 and 3.7.2 respectively, in order for us to investigate the issue?

Thanks, Ashish

Scorpio59 commented 2 years ago

may be link to #1996 we experience the same bug, it work well on local with SSO profile but it take longer with normal profile

ashishdhingra commented 2 years ago

may be link to #1996

we experience the same bug, it work well on local with SSO profile but it take longer with normal profile

@Scorpio59 The other issue doesn't appear to be related since user was getting different execution times due to way credentials were configured.

dannystommen commented 2 years ago

@ashishdhingra I managed to create a sample. Can I sent you this via a DM/email instead of sharing the sample here? I stripped down one of our production projects, which I can not share here publically.

ashishdhingra commented 2 years ago

@ashishdhingra I managed to create a sample. Can I sent you this via a DM/email instead of sharing the sample here? I stripped down one of our production projects, which I can not share here publically.

@dannystommen We need to come up with the minimal reproducible sample to investigate the issue (reference https://stackoverflow.com/help/minimal-reproducible-example). May be just a test case having issue!

dannystommen commented 2 years ago

@ashishdhingra I managed to make it minimal, find attached the zip file, with 1 single test in it.

I also managed to find the "cause". Removing line 11-15 in the Configuration.cs file makes the test fast again.

test-aws-sdk-extensions-setup.zip

Let me know if this is suffiecient, or need anything als from my end.

normj commented 2 years ago

@dannystommen Can you describe your pipeline setup? Is it AWS CodeBuild or something else and how are credentials expected to be retrieved for the service clients?

dannystommen commented 2 years ago

@dannystommen Can you describe your pipeline setup? Is it AWS CodeBuild or something else and how are credentials expected to be retrieved for the service clients?

It's running in gitlab. If you commit this code to a gitlab repo, it will automatically run the pipeline (gitlab-ci.yml is included).

Not sure what you mean with "how are credentials expected to be retrieved".

dannystommen commented 2 years ago

@ashishdhingra any updates on this?

kellyrbourg commented 1 year ago

Just ran into this issue on a brand new project. 30s to create a client through options.CreateServiceClient in 3.7.2 vs 125ms in 3.7.0. We do have SSO set up as well but we use a tool like yawsso to sync creds.

zippo227 commented 1 year ago

I was able to fix it what that solution. Add this to your .json, of course merge it within a current AWS block where applicable without including the additional block.

"AWS": { "DefaultsMode": "Standard" },