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

Some of the unittests are flaky in CI #4344

Closed
zadjii-msft opened this issue Jan 23, 2020 · 6 comments
Closed

Some of the unittests are flaky in CI #4344

zadjii-msft opened this issue Jan 23, 2020 · 6 comments
Assignees
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Tag-Fix Doesn't match tag requirements Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Meta The product is the management of the products. Resolution-No-Repro We couldn't get this to happen, or it stopped happening entirely.

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented Jan 23, 2020

FYI, the current build failure is just the unit tests timing out, which seems to happen quite often in the CI build. I don't think there's actually anything wrong with the code itself.

Originally posted by @j4james in #3943 (comment)

A case in point build: link to ADO. (EDIT: Okay this is really bad now )

This has been happening for a couple weeks now, where sometimes a test run in CI will hang. This time it happened somewhere around these tests:

  √ TestResize
  √ TestCursorVisibility [15ms]
  √ ConptyOutputTestCanary [15ms]
  √ SimpleWriteOutputTest [15ms]
  √ WriteTwoLinesUsesNewline
  √ WriteAFewSimpleLines
##[error]The operation was canceled.
Finishing: Run Unit Tests

This has happened in the past before and was notoriously hard to pin down - last time it had to do with how VtIo/VtRenderer was getting dtor'd. Hopefully we can figure out what's causing this.

As an additional note - there's vso_ut.cmd in the repo that attempts to run the unittests the same way ADO does, but that script hasn't been updated in a while.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jan 23, 2020
@zadjii-msft zadjii-msft added Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Meta The product is the management of the products. labels Jan 23, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jan 23, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Jan 23, 2020
@j4james
Copy link
Collaborator

j4james commented Jan 23, 2020

FYI, PR #4295 caused the unit tests to time out yesterday as well (link to ADO). The exact location where it stops is slightly different, but it looks to me like the test execution order is not guaranteed - I'm guessing because it's running multiple tests in parallel? If that's the case, it may be an interaction between two test running at the same time that is the source of the issue.

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jan 23, 2020
@DHowett-MSFT
Copy link
Contributor

Yanking triage- we see this phenomenon everywhere, and we should close on why it happens.

@j4james
Copy link
Collaborator

j4james commented Jan 24, 2020

Anyone wanting to try and reproduce this locally, I think this is what the test_cmd variable needs to be updated to in the vso_ut.cmd script to match the CI server:

set test_cmd=%VSTEST_PATH% ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\ConAdapter.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\ConParser.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\Conhost.Interactivity.Win32.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\Conhost.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\Terminal.Core.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\TextBuffer.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\Types.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\UnitTests_TerminalApp\Terminal.App.Unit.Tests.dll" ^
 "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\til.Unit.Tests.dll" ^
 /Settings:"%OPENCON%\src\unit.tests.%ARCH%.runsettings" ^
 /EnableCodeCoverage ^
 /logger:trx ^
 /TestAdapterPath:"%OPENCON%" ^
 %*

Also note that you'll likely have to update the VSTEST_PATH to match whatever version of Visual Studio you have installed.

That said, I've run this test probably dozens of times now, sometimes multiple instances at the same time, and I've not yet found a way to make it hang.

@zadjii-msft
Copy link
Member Author

Welp, one of the builds from #4382 still got stuck, so that one wasn't the fix.

@zadjii-msft zadjii-msft removed the In-PR This issue has a related PR label Jan 29, 2020
@miniksa
Copy link
Member

miniksa commented Jan 29, 2020

#4384 is where I've been playing around and trying to fix this.

I've identified that Terminal.Core.Unit.Tests.dll is the one that appears to be causing the problem.

EDIT:

  • I ran it tons of times with just the tests. When I have every test but that one, it's fine. When I reintroduce that one, it hangs.

@miniksa
Copy link
Member

miniksa commented Jan 29, 2020

OK, I also ran it with only the terminal core tests and it hangs. So it's that guy. I'll try to dig in.

@miniksa miniksa self-assigned this Jan 29, 2020
@miniksa miniksa added Priority-0 Bugs that we consider release-blocking/recall-class (P0) and removed Priority-3 A description (P3) labels Jan 29, 2020
@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 29, 2021
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Feb 1, 2021
@zadjii-msft zadjii-msft added the Resolution-No-Repro We couldn't get this to happen, or it stopped happening entirely. label Feb 1, 2021
@zadjii-msft zadjii-msft removed this from the Terminal Backlog milestone Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Tag-Fix Doesn't match tag requirements Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Meta The product is the management of the products. Resolution-No-Repro We couldn't get this to happen, or it stopped happening entirely.
Projects
None yet
Development

No branches or pull requests

4 participants