Unit Test Sessions reports "Inconclusive: Test not run"

I'm running into this problem quite frequently.  Everything works, and then I run some tests and get the following error:

In the error log I see:

Rebuilding doesn't help, nor does closing and re-opening Visual Studio.  Sometimes, if I click on a single unit test and run that, it works.  It somewhat appears that I might get myself into this state if I run an entire session and one of the tests in that session fail.  It's tough to really for sure, but mainly I'd like to understand what this error means and what "left pending" implies.

I'm running Visual Studio Pro 2017 (Version 15.5.6)

reSharper Ultimate 2017.3.2

MSTest.TestAdapter NuGet Package 1.1.18

MSTest.TestFramework NuGet Package 1.1.18

 

Any ideas would be helpful!

56 comments

Are you including MSTest.TestAdapter in that specifik project? It compiles fine and works in Visual Studios testrunner without it.
I've had the same problem when it wasn't included. As soon as I added the package it works...

1

I have started getting a similar issue the last few days using 2018.1.

I have a suite of XUnit tests, which have been working fine for the past year.

Now, when I choose "Run All Tests from Solution", nothing appears to happen. The Unit Test window doesn't even open. If I manually open the Unit Test window (Ctrl+Alt+R), the tests look like they are trying to run: the 'loading' bar is animated, and the "Run" icons are disabled. However there is no indication of any activity other than that, and even after a few minutes of waiting, the tests never run. The "Stop" buttons are also disabled, so I have to restart Visual Studio to stop the test runner doing whatever it thinks it's doing.

Like the original post, sometimes I am able to run individual or groups of tests successfully by clicking "Run" in the Unit Test session window. This then seems to cause Resharper to start behaving normally again. However this is not always the case, and sometimes individual tests will not run. I haven't worked out what causes it to behave differently sometimes.

1

Try to debug the failing test. I discovered that way that this exception was caused by a StackOverflowException in one of my tested methods. See also https://youtrack.jetbrains.com/issue/RSRP-470510 

1

Hey guys, 

Same issue here. I'm using C++ ReSharper with Google Tests and when I click on one of the tests or all of them, it won't run them with this error.

This happens in Debug and Release mode while trying to test a library project.

1

Still happens for me:

xUnit 2.1.0

Visual Studio Enterprise 2017 (version 15.8.7)

ReSharper Ultimate (version 2018.2.3)

When I run Visual Studio with elevated privileges, this issue is gone.

Tried all suggestions above - clean cache, restart VS, clean solution, physically remove bin/obj folders etc...

1

Happening for me too.

Xunit 2.4.1,

VS Community 2017 15.9.3,

Resharper Ultimate 2018.2

1

Late-joining to drop a line or two about some tweaks that got things working on our environment:

1. Update visual studio + resharper + unit testing libs (MSTest nugets etc) to their latest versions. Also make sure that if all of your test-dlls spawn on the same output folder that their respective mstest-nugets are aligned (same versions)

2. Make sure that the app.config of your test-projects exist and make sense in terms of EF and so on.

3. Shut down visual studio and perform a deep-clean on both system-wide temp-folders and on the temporary files of your source-code. Here are two powershell scripts to help you do exactly that:

$folders = @("bin", "obj", ".axoCover", ".vs", "more.folders.here")
gci -force -include $folders -recurse | remove-item -force -recurse

$tempfolders = @("C:\Windows\Temp\*", "C:\Windows\Prefetch\*", "C:\Documents and Settings\*\Local Settings\temp\*", "C:\Users\*\Appdata\Local\Temp\*")
Remove-Item $tempfolders -force -recurse

4. Double-check that the .vs folder has been wiped out (sometimes the scripts above fail to remove it for w/e reason). If it's not gone then delete by hand.

5. Re-open visual studio on your solution, restore nuget packages and run your tests. Everything should work now.

Hope this helps some people save some time.

1

Same issue here in latest Resharper (downloaded today,23rd Dec 2018)

Issue appears to be related to using async in tests (if you have to await a call)

 

https://danielhillebrand.com/2017/09/inconclusive-error-in-resharper-unit-test-runner-caused-by-async-void/

Workaround, use Task.Result instead of await 

 

 

1

Why after all these years... is this still a thing? Why? I think I have spent more time trying to get my tests to run via resharper than I have spent writing them. Running 2018.2.3 and .... yup.. open up an xunit 2.1.0 project and .. yup.. nothing works .. all inconclusive.. of a standard .net 4.7 project. 

i just keep getting this error even after upgrading to 18.3.x 

2019.02.14 16:05:03.809 WARN Exploration exceeded 30 seconds timeout. Continuing...

im just trying to run one little test.. .come on.. 

1

The same issue.

I create very simple cmake project in Visual Studio 2017.

Repository link: https://github.com/GillianGrayson/oqs/tree/test_issue (branch test issue).

I use Catch2 (resharper supports it) as git submodule.  I tried different configurations but result the same:

Bu if i run tests using simple command ctest everything is ok!

Reharper team, please fix it!

Thank you!

1

Hello Michael!

 

Thank you for contacting us.

Could you please try clearing and rebuilding solution and check if it help?

If the problem persists please start VS with the following command: 'devenv /ReSharper.LogFile C:\log\resharper_log.txt /ReSharper.LogLevel Verbose', reproduce the issue and send log file to us (via 'Sumbit a request' form).

Thank you.

0

Sure.  Did a clean then rebuild.  Sending you the file now.

0

Yup, here's my packages.config file on that particular project:

<packages>
<package id="Common.Logging" version="3.3.1" targetFramework="net452" />
<package id="Common.Logging.Core" version="3.3.1" targetFramework="net452" />
<package id="FluentAssertions" version="4.19.2" targetFramework="net452" />
<package id="log4net" version="2.0.3" targetFramework="net452" />
<package id="Microsoft.ApplicationServer.Caching.Client" version="1.0.4657.2" targetFramework="net452" />
<package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net452" />
<package id="MSTest.TestFramework" version="1.1.18" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="Quartz" version="2.5.0" targetFramework="net452" />
<package id="StackExchange.Redis" version="1.2.4" targetFramework="net452" />
</packages>
0

Even when I do a complete rebuild, this occurs on most of my tests. I am using .Net Core 2.1 with a targetFramework of netcoreapp2.0. I disabled the shadow copy. MSTest.TestAdapter and MSTestFramework are in the PackageReference(s), although mine are version 1.2.0. I am using the latest version of Visual Studio and Resharper (not beta).

Even when it works, if I click on the test and then the panel to the right, it wipes out the results, clearing the panel, and switches it to "Inconclusive". It would be great if there were a better error message as to WHY it is "Inconclusive".

I will follow your directions for creating the log file and submit it.

0

Bug occurs with new Resharper version too:

MS Test Unit Tests can be executed, but not debugged. Error: Inconclusive. Test not run

We are using Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll Version 10.0.0


JetBrains ReSharper Ultimate 2018.1 Build 112.0.20180414.70444
ReSharper 2018.1.20180414.71556

Visual Studio: 15.6.4.

 

0

Hello Stgu!

 

Thank you for the feedback.

Is there any chance you could provide us a sample solution demonstrating the issue? You can do it privately via 'Sumbit a request' form.

Thank you.

0

This is just another data point. This problem was getting really hard to deal with, and then I got a notification of an update to 2017.3.5 build on 2018-03.23. So I installed it and all my problems went away! Yeah! The Visual Studio version is Enterprise 2017 (version 15.5.27130.0).

0

I am seeing this too, but only on static methods of a small static utility class I have for modifying strings. I can run the tests just fine individually, but not reliably by running "all" tests for a c# file, project, or solution. I have had issues like this before with ReSharper and XUnit (not always with static types). It is a recurring problem that seemingly emerges from time to time.

17:05:42.647 |W| UnitTestLaunch | :43 | Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. at System.Net.Sockets.NetworkStream.Read(Span`1 destination) at System.Net.Sockets.NetworkStream.ReadByte() at System.IO.BinaryReader.ReadByte() at System.IO.BinaryReader.Read7BitEncodedInt() at System.IO.BinaryReader.ReadString() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken) Source: System.Net.Sockets HResult: -2146232800 Inner Exception: An existing connection was forcibly closed by the remote host HResult: -2147467259

--- EXCEPTION #1/1 [LoggerException]
Message = “
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
at System.Net.Sockets.NetworkStream.Read(Span`1 destination)
at System.Net.Sockets.NetworkStream.ReadByte()
at System.IO.BinaryReader.ReadByte()
at System.IO.BinaryReader.Read7BitEncodedInt()
at System.IO.BinaryReader.ReadString()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken)
Source: System.Net.Sockets
HResult: -2146232800

Inner Exception: An existing connection was forcibly closed by the remote host
HResult: -2147467259

ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.OnRunComplete(ExecutionCompletePayload payload)
at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentActionHolder`1.Execute(Object argument)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.PerformActions(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.StateMachine`2.Fire(TEvent eventId, Object eventArgument)
at Appccelerate.StateMachine.ActiveStateMachine`2.ProcessEventQueue(CancellationToken cancellationToken)
at Appccelerate.StateMachine.ActiveStateMachine`2.<Start>b__32_0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.ThreadPoolTaskScheduler.LongRunningThreadWork(Object obj)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)

17:05:42.646 |E| XunitDotNetVsTestRunStrategy | :43 | Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. at System.Net.Sockets.NetworkStream.Read(Span`1 destination) at System.Net.Sockets.NetworkStream.ReadByte() at System.IO.BinaryReader.ReadByte() at System.IO.BinaryReader.Read7BitEncodedInt() at System.IO.BinaryReader.ReadString() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken) Source: System.Net.Sockets HResult: -2146232800 Inner Exception: An existing connection was forcibly closed by the remote host HResult: -2147467259

--- EXCEPTION #1/1 [LoggerException]
Message = “
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
at System.Net.Sockets.NetworkStream.Read(Span`1 destination)
at System.Net.Sockets.NetworkStream.ReadByte()
at System.IO.BinaryReader.ReadByte()
at System.IO.BinaryReader.Read7BitEncodedInt()
at System.IO.BinaryReader.ReadString()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken)
Source: System.Net.Sockets
HResult: -2146232800

Inner Exception: An existing connection was forcibly closed by the remote host
HResult: -2147467259

ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
Data.ManagedThreadName = <NULL>
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.OnRunComplete(ExecutionCompletePayload payload)
at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentActionHolder`1.Execute(Object argument)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.PerformActions(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.StateMachine`2.Fire(TEvent eventId, Object eventArgument)
at Appccelerate.StateMachine.ActiveStateMachine`2.ProcessEventQueue(CancellationToken cancellationToken)
at Appccelerate.StateMachine.ActiveStateMachine`2.<Start>b__32_0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.ThreadPoolTaskScheduler.LongRunningThreadWork(Object obj)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)

0

The issue I mentioned above seems to be better after upgrading my project's references to xunit and xunit.runner.visualstudio to the latest version.

0

Sorry, I spoke too soon. I am still receiving the issue, even after upgrading the xunit DLLs. It is quite intermittent though, and I haven't figured out a reliable work around, other than restarting Visual Studio, lots of cleaning and rebuilding etc.

0

I have the same problem since I updated to ReSharper 2018.1 Things were working fine until then.
I have VS 15.6.6. I am wondering will updating to visual studio 15.6.7 make it better or worse?

0

Started having the same issue using NUnit for all tests using TestCaseSource attribute. Sometimes they would still run, but in most case would get the error as others mention.

JetBrains ReSharper Ultimate 2018.1 Build 112.0.20180414.70444
dotCover 2018.1.20180414.124358
dotTrace 2018.1.20180414.71711
ReSharper 2018.1.20180414.71556
dotMemory 2018.1.20180414.71710

Visual Studio Professional 2017 (version 15.5.27130.2036).

UPDATE: Seems like it only happens for generic test methods, like:

[TestCaseSource(nameof(ValuesToCache))]
public void Get_GivenValueWasPut_ReturnsValueThatWasPut<T>(T value)

 

0

This could be caused by other test session being still active somewhere in background. Verify you don't have 'dotnet' stale processes running in background.

0

I am having the same problem. I submitted a bug for this way back in April (4 months ago), and as far as I can tell, no one has looked at it yet.

https://youtrack.jetbrains.com/issue/RSRP-469301

0

I am seeing that when I run all unit tests for an entire project, I get about half of the 70 tests failing, but when I run each of those tests individually, they all pass just fine.  The same thing happens when I run "Cover All Tests From Solution".   The same projects show about half of the tests failing, but when I run the tests individually, they pass.   

0

@Seansinykin I ran into the same issue when your test fixture class retains some sort of a context between tests. If you run them individually the fixture is created and destroyed. But if you run them all, the context is retained and may cause your tests to fail. To avoid this you can create all the context, like mocks etc., in the setup method. This way it will be recreated for each test.

0

Please sign in to leave a comment.