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

Test PackageUpdateResource_SourceAndSymbolNuGetOrgPushingAsync is flaky #10706

Open
zivkan opened this issue Mar 30, 2021 · 5 comments
Open

Test PackageUpdateResource_SourceAndSymbolNuGetOrgPushingAsync is flaky #10706

zivkan opened this issue Mar 30, 2021 · 5 comments
Labels
Priority:2 Issues for the current backlog. Type:DCR Design Change Request Type:Test

Comments

@zivkan
Copy link
Member

zivkan commented Mar 30, 2021

The test NuGet.Protocol.Tests.PackageUpdateResourceTests.PackageUpdateResource_SourceAndSymbolNuGetOrgPushingAsync appears to make real network connections to nuget.org and nuget.smbsrc.net. it's just flaky

I don't think our CI should block PRs being merged if an external resource has a service outage, or the CI agent is having flakey network access to the outside world.

@donnie-msft
Copy link
Contributor

donnie-msft commented Apr 1, 2021

@donnie-msft donnie-msft reopened this Apr 1, 2021
@zkat zkat added the Priority:2 Issues for the current backlog. label Apr 12, 2021
@kartheekp-ms
Copy link
Contributor

NuGet.Protocol.Tests.PackageUpdateResourceTests.PackageUpdateResource_SourceAndSymbolNuGetOrgPushingAsync test has failed in three 1, 2, 3 official builds recently.

One commonality in all the failures is the test is failing for symbolSource: https://nuget.smbsrc.net/ input.

https://github.com/NuGet/NuGet.Client/blob/d2bb0de35242b04802c1a7856ebb7718f674565c/test/NuGet.Core.Tests/NuGet.Protocol.Tests/Resources/PackageUpdateResourceTests.cs#L226-L231

@donnie-msft
Copy link
Contributor

donnie-msft commented Apr 27, 2021

Took a quick look but not sure what we want to do here. If we Mock, then it no longer verifies how expected responses are handled by Push.
We could skip the test, skip only the "faulty" symbol source, add support for HTTP retries, ...other?

Also when I ran fiddler, this didn't emit any HTTP traffic that I could see.

@donnie-msft donnie-msft self-assigned this Apr 27, 2021
@donnie-msft donnie-msft added this to the Sprint 2021-04 milestone Apr 27, 2021
@zivkan
Copy link
Member Author

zivkan commented Apr 27, 2021

I took a quick look myself.

Firstly, I was wrong about it making real network connections. The test uses StaticHttpHandler.CreateSource, which implementes a `HttpClientHandler, which looks up URLs and pre-canned responses in a dictionary which the test itself provides.

Having written all that, I don't currently have any ideas why the test sometimes times out. The test itself specifies 5 second time out, and given that NuGet.Protocol tries requests 3 times by default, that explains the 15 second duration when tests fail.

What I'm confident about is that repeating the test 4 times is pointless.

It would be better for the tests to use a fake domain name ending in .test, to make it clear that it's not making real HTTP requests.

Given all this, I'm going to skip this test because it's too flaky at the moment.

@zivkan zivkan changed the title Test PackageUpdateResource_SourceAndSymbolNuGetOrgPushingAsync makes network connections Test PackageUpdateResource_SourceAndSymbolNuGetOrgPushingAsync is flaky Apr 27, 2021
@donnie-msft donnie-msft removed their assignment Apr 27, 2021
@donnie-msft donnie-msft removed this from the Sprint 2021-04 milestone Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Issues for the current backlog. Type:DCR Design Change Request Type:Test
Projects
None yet
Development

No branches or pull requests

7 participants