You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new "Unit Test Project(.NET Core)" project into this solution.
Refer above console app in this unit test project.
Call your sample code in this unit test project's test method
Have a negative test also which fails.
Run the test methods(Try different ways to run)
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
The text was updated successfully, but these errors were encountered:
@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?
@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.
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
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.Task
1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task
1.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(IEnumerable
1 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.Task
1.GetResultCore(Boolean waitCompletionNotification)at System.Threading.Tasks.Task
1.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(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
The text was updated successfully, but these errors were encountered: