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

[C#][.Net Core][UT&Desktop] Cancel "Run All" failed and throw 2 errors #1568

Closed
EdwardDing opened this issue Apr 28, 2018 · 4 comments
Closed
Labels

Comments

@EdwardDing
Copy link

Description

Cancel "Run All" failed at the seconding cancelling and 2 error messages will be thrown in output window.

Steps to reproduce

Repro gif: \mlangfs1\public\v-zchan\CancelRunAll.gif

  1. Create a Console App(.NET Core) application
  2. Have your sample test methods in your project.
  3. Add a new "Unit Test Project(.NET Core)" project into this solution.
  4. Refer above console app in this unit test project.
  5. Call your sample code in this unit test project's test method
  6. Have a negative test also which fails.
  7. Run the test methods(Try different ways to run)
  8. Run the test methods again and then click "Cancel" quickly

Expected behavior

Cancel execution successfully.

Actual behavior

Cancelling failed and throw 2 errors as following:
Error message:
[4/26/2018 11:14:24 PM Informational] ------ Run test started ------
[4/26/2018 11:14:29 PM Error] Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Failed to launch testhost with error: System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, CancellationToken cancellationToken)
---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---

at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable1 sources, CancellationToken cancellationToken) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler) [4/26/2018 11:14:29 PM Error] Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Failed to launch testhost with error: System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result() at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable1 sources, CancellationToken cancellationToken)
---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---

at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, CancellationToken cancellationToken)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
[4/26/2018 11:14:29 PM Informational] ========== Run test finished: 0 run (0:00:05.1030327) ==========

Diagnostic logs

None

Environment

Visual Studio d15.7\27625.00

@mayankbansal018
Copy link
Contributor

@EdwardDing apart from observing exception messages in Test output pane, are you also observing any additional issues, for e.g. your subsequest run test doesn't work, or incorrect result?

@EdwardDing
Copy link
Author

@mayankbansal018 The subsequest run test is working and no incorrect result, but if canceling, sometimes, the output window will show this exception, and cancel will failed. Sometimes, cancel is successful.

@singhsarab
Copy link
Contributor

@EdwardDing We have recently made fixes around to cancellation.
Like: #1543

Can you please try moving to latest bits of VS and then re-try.

@singhsarab singhsarab added the bug label Jun 6, 2018
@singhsarab
Copy link
Contributor

@EdwardDing I am closing the issue. Let's re-open if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants