Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Test Sessions failed to execute

I'm using VS2015 professional with resharper ultimate and I've started to get the following error in the unit test session window when I'm executing my unit tests.

2016.09.21 14:16:54.745 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.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.DiscoveryStage.Run(CancellationToken token) at JetBrains.ReSharper.UnitTestFramework.Launch.UnitTestLaunch.RunStage(Object stageObject) ---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---

tests of other projects works perfectly in VS2013 but not in VS2015. Yesterday I've installed couple of packages on my pc: vs14-kb3165756.exe and OpenCover.UI.vsix

I've tried to uninstall the OpenCover package which didn't solved the issue.

like image 441
silver Avatar asked Sep 21 '16 11:09

silver


People also ask

How do you unit test a session?

To open this window, press Ctrl+Alt+T or choose ReSharper | Windows | Unit Test Sessions from the main menu. The window also opens automatically each time you run or debug unit tests from the current document or from the project/solution, create a new test session, or add tests to a test session.

How do I run unit tests with ReSharper?

Ctrl+U D on the toolbar. Ctrl+U D commands, which are also available in the main menu (ReSharper | Unit Tests) and in the context menu. To run or debug all tests in solution, choose ReSharper | Unit Tests | Run All Tests from Solution in the main menu or press Ctrl+U L .

How to run tests in rider?

You can click the unit test icon next to the test class and choose Run All to run all tests in that class. JetBrains Rider will start the tests and bring up the Unit Tests window where you can see test progress and results.


2 Answers

For anyone experiencing this issue, after re-adding a UWP Unit Test project multiple times, I found that after I created the new Unit Test Project (Universal Windows), in the Solution's Configuration Manager, for some reason the Build CheckBox was unchecked, and when I checked it, and ran my unit tests, all was executing as expected.

Right Click Solution > Configuration Manager...

like image 62
Donald N. Mafa Avatar answered Oct 06 '22 00:10

Donald N. Mafa


I just had same issue, in my case solution configuration was set to "Release". Make sure all your project set to "Debug" and re-try. Worked for me

like image 27
katit Avatar answered Oct 05 '22 23:10

katit