Skip to content

Fix flakiness/timeout in gRPC template tests #19982

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

Merged
merged 12 commits into from
Mar 25, 2020
Merged

Conversation

JunTaoLuo
Copy link
Contributor

Do not search for port number for cases where we are testing for failure.

I don't know how these tests ever passed on macOS.

@JunTaoLuo JunTaoLuo requested a review from BrennanConroy March 19, 2020 03:12
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Mar 19, 2020
@JunTaoLuo JunTaoLuo force-pushed the johluo/fix-grpc-template branch from 642ca2c to f89277a Compare March 19, 2020 03:13
@JunTaoLuo JunTaoLuo added area-grpc Includes: GRPC wire-up, templates and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Mar 19, 2020
@JamesNK
Copy link
Member

JamesNK commented Mar 19, 2020

I don't know how these tests ever passed on macOS.

Did the change in #19252 do it?

@JunTaoLuo
Copy link
Contributor Author

Ah that's probably it.

@BrennanConroy
Copy link
Member

You may have fixed the test failure flakiness, but you haven't fixed the hang.

@JunTaoLuo
Copy link
Contributor Author

Argghh, I'll see what's causing the hang now.

@Pilchie
Copy link
Member

Pilchie commented Mar 19, 2020

👀

@JunTaoLuo JunTaoLuo force-pushed the johluo/fix-grpc-template branch from 4c1bcc2 to 9a2de83 Compare March 25, 2020 05:01
@JunTaoLuo
Copy link
Contributor Author

FYI don't review yet, still testing a few hypotheses.

@dougbu
Copy link
Contributor

dougbu commented Mar 25, 2020

Can we please skip these tests while investigating?

@BrennanConroy
Copy link
Member

Can we please skip these tests while investigating?

?? These tests are skipped in the main runs...

@dougbu
Copy link
Contributor

dougbu commented Mar 25, 2020

Aren't the tests causing quarantined runs to timeout?

@BrennanConroy
Copy link
Member

Were causing, hence they were skipped.

@JunTaoLuo
Copy link
Contributor Author

I have fixed the tests already, I'm just trying to pin down a more specific cause for the test hangs. And no, the whole point is to figure out what was happening in these tests so we shouldn't be skipping them.

@JunTaoLuo
Copy link
Contributor Author

Okay with the latest test failure (https://dev.azure.com/dnceng/public/_build/results?buildId=573237&view=ms.vss-test-web.build-test-results-tab&runId=17971944&paneView=debug&resultId=100107), I think I've confirmed that:

  1. The underlying issue is that we were trying to scrape a port in the test case where we expect failure, this can cause a hang, but there seems to be a race since sometimes the test might timeout and fail instead.
  2. While fixing 1. I created a new issue where we were not waiting for process exit in the test cases where we expected failure. This manifested as additional flakiness with the updated runtime but appeared as a hang with the old runtime.

Having fixed both issues, I think we are ready to run these tests under quarantine again.

@JunTaoLuo JunTaoLuo requested review from BrennanConroy and removed request for BrennanConroy and dougbu March 25, 2020 20:21
[SkipOnHelix("Not supported queues", Queues = "Windows.7.Amd64;Windows.7.Amd64.Open;OSX.1014.Amd64;OSX.1014.Amd64.Open")]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19716")]
public async Task GrpcTemplate()
{
// Setup AssemblyTestLog
var assemblyLog = AssemblyTestLog.Create(Assembly.GetExecutingAssembly(), baseDirectory: Project.ArtifactsLogDir);
Copy link
Member

Choose a reason for hiding this comment

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

Why are we doing this here instead of the normal way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Glad you asked. Normally, we would be using LoggedTest but that requires the use of AspNetTestFramework xunit test framework. This cannot be used in template tests since they already use their own test framework:

[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "ProjectTemplates.Tests")]
and so we have to do it the oldschool way.

I think it's possible to combine the logic of the two xunit frameworks but that's a rather large undertaking that doesn't seem appropriate here.

Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

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

The test log stuff seems odd, but I like the overall change

@analogrelay analogrelay added this to the 5.0.0-preview3 milestone Mar 25, 2020
@JunTaoLuo JunTaoLuo merged commit 20f6d65 into master Mar 25, 2020
@JunTaoLuo JunTaoLuo deleted the johluo/fix-grpc-template branch March 25, 2020 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-grpc Includes: GRPC wire-up, templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants