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!

16
78 comments
Official comment

@Roland Oldengarm and @Michael Milgevkiy

There is an inherent problem in usage of DateTime.Now as well as any other source that return a different value on every call. That means that each time NUnit executes discovery, new test-case will be created with id not matching to test-cases previously produced by the same method. An attempt to execute such test-case using 'vstest' (which is how we run tests that target .netcoreappXX) will ultimately fail, because at the time of running, there won't be such test-case.

Because of this and number of other issues with vstest runner, we are going to implement our own runner for projects targeting .netcoreappXX.

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 

2
Avatar
Permanently deleted user

Hi 

I have the same issue in Rider 2019.2 (Build #RD-192.5895.1069) and NUnit 3.11.0.

I faced with Inconclusive tests for the next case:

private static IEnumerable<TestCaseData> Test_data = new[]
{
new TestCaseData(DateTime.Now)
};
[TestCaseSource(nameof(Test_data))]
public void Foo_test(DateTime date)
{
// No code here - just an empty function
}

Pay attention to DateTime.Now in Test_data array. If you change it to "new DateTime()" - everything works as expected.

private static IEnumerable<TestCaseData> Test_data = new[]
{
new TestCaseData(new DateTime())
};

 

2
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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

Hello Helen!

 

The error messages says:

Unable to find tests for C:\code\InterviewTests\MyTests\bin\Debug\netcoreapp2.0\MyTests.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate.

Could you please check that all nuget packages with correspondent versions are included? Have you tried running tests using VS test runner?

Thank you.

1
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

Happening for me too.

Xunit 2.4.1,

VS Community 2017 15.9.3,

Resharper Ultimate 2018.2

1
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

ReSharper 2019.1

Some tests look like this one

[TestCase(null, TestName = "BuildAsync_When_QuoteId_Is_Null_Calls_Logger")]
[TestCase("", TestName = "BuildAsync_When_QuoteId_Is_Empty_Calls_Logger")]
public async Task BuildAsync_When_QuoteId_Is_Empty_Calls_Logger(string quoteId)
{
// Arrange
_serviceMock.Setup(x => x.GetQuotesAsync(It.IsAny<ClaimsPrincipal>())).ReturnsAsync(GetQuotes(quoteId));

// Act
await _builder.BuildAsync(_coverListConfiguration, It.IsAny<ClaimsPrincipal>());

// Assert
_loggerMock.Verify(x => x.LogTrackTrace(It.IsAny<string>(), SeverityLogLevel.Error), Times.Once);
}

 

I have tried to update NUnit to 3.12 but it does not help me

1
Avatar
Permanently deleted user

I using 2019.1.1

Please send me e-mail with your e-mail. I'll send you more information.

1

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

0

Thanks again!  Ticket #1259424

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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

Please sign in to leave a comment.