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!

78 comments
Comment actions Permalink

Hello Emil!

 

You could send all information using 'Submit a request' form at the top of the page.

Thank you.

0
Comment actions Permalink

Hi,

 

Given this thread seems to still be active, in case this is helpful for anyone:

I am using xUnit and encountered this issue. Finally, after much digging, I found the problem that I was having.

I was using Moq to mock out 'DbConnection' and 'DbCommand'. Both of these inherit from 'Component' which has a '~Finalize' method, which in-turn calls 'Dispose'. Because I was using 'Strict' mocks, whenever GC tried to destory the object after running a test, it would call the virtual Dispose method resulting in a 'MockException' (since I was not mocking the protected Dispose method). This was causing the test runner to crash and Resharper to treat all yet-unfinished tests as either 'Inconclusive' or 'Aborted'. The test causing the problem was never the test that was killed and hence it was a real pain to find the underlying problem. 

To see if this affects you, just enable the Verbose output in Options --> Unit Testing --> General (Show log entries with severity) in Resharper, and then after running the tests you may see the following (or similar) error.

 

INFO Process C:\Program Files\dotnet\dotnet.exe:20856 has exited with code (-532462766)
Output stream:
Unhandled Exception: Moq.MockException: Component.Dispose(False) invocation failed with mock behavior Strict.
All invocations on the mock must have a corresponding setup.
at Moq.Mock.Moq.IInterceptor.Intercept(Invocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at System.ComponentModel.Component.Finalize()

 

If you see something like this, then the solution is to mock the protected 'Dispose(bool)' method for anything that inherits from 'Component'. For example in my case, the solution was something like this:

ConnectionMock.Protected().Setup("Dispose", true, false)

or

commandMock.Protected().Setup("Dispose", true, ItExpr.IsAny<bool>());

 

I hope someone can find this and help themselves avoid days of headaches.

 

0
Comment actions Permalink

I have same issue still, when using TestCase attribute with TestName param 

I'm using NUnit, NSubstitude, netcore 2.2 and newest Rider 2019.2, also my collegue with newest ReSharper + VS2019. 

Tests are either ignored or reports inconclusive error

When not passing TestName everything is fine

Tests are running parallel and are async Task

0
Comment actions Permalink

Hello @Pada190814,

 

the problem is that NUnit does not include the name of the test method into test ids of test cases when TestName property is used. Please refer to the following issue - https://youtrack.jetbrains.com/issue/RSRP-458646.

Thank you.

0
Comment actions Permalink

I've got the same issue as Michael, but in my case I'm using ValueSource. If I use "DateTime.Now" the problem occurs. When I change that to new DateTime() it works fine.

0
Comment actions Permalink

Hello,

 

Using of

new TestCaseData(DateTime.Now)

generates a new test case for every call, which leads to the problem that during test discovery we've got test case of DateTime X, but when we are trying to execute this test there's actually no such test case as there's already new DateTime Y. This behavior is reproduced only for .NET Core projects and Visual Studio acts the same way. As long as we use vstest runner we cannot change this behavior. Good news is there're plans to develop our own test runner.

Thank you.

0
Comment actions Permalink

Note: I got this error also in feb 2020. However, there was an error in the App.config that gave this side effect. The error message gave very little little hints about it since it was just a nullreference exception in NUnit due to the error when reading the config file. 

0
Comment actions Permalink

I have the same issue.

I have created a fresh solution, with only an NUnit Test Project and only this simple test:

using NUnit.Framework;

namespace NUnitTestProject1
{
public class Tests
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test1()
{
     Assert.IsTrue(true);
}
}
}

 

Result:
Test1 is Inconclusive.

Runs fine with the Visual Studio built-in test runner.

JetBrains ReSharper Ultimate 2019.2.3 Build 192.0.20191016.60459 built on 2019-10-16
dotTrace 2019.2.20191016.63252
ReSharper 2019.2.20191016.62805

0
Comment actions Permalink

@Eric Robishaw, what VS version are you using? Is it VS 2019? If so, do you have a chance to try installing the latest 2020.2.3 as it is compatible with the latest VS 2019 versions? Thank you!

0
Comment actions Permalink

Maria Pleskunina I'm experiencing this problem right now, I'm using the latest version of Rider on Ubuntu and there are exceptions in test run logs (the log file: https://drive.google.com/file/d/1D4IAdmiChVG_Ay_l0kRHS3ntk2lx_8fm/view?usp=sharing).

Rider version:

JetBrains Rider 2020.2.4
Build #RD-202.7660.16, built on September 30, 2020
Licensed to ...
You have a perpetual fallback license for this version
Subscription is active until ...
Runtime version: 11.0.8+10-b944.34 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
.NET Core 3.1.6
Linux 5.4.0-52-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1466M
Cores: 4
Registry: debugger.new.debug.tool.window.view=true, ide.tree.horizontal.default.autoscrolling=false, performance.watcher.sampling.interval.ms=200, ide.borderless.tab.caption.in.title=false, ide.tooltip.showAllSeverities=true, show.diff.preview.as.editor.tab=true, light.edit.file.open.enabled=false, performance.watcher.unresponsive.interval.ms=1000, search.everywhere.settings=true, show.diff.preview.as.editor.tab.with.single.click=true, parameter.info.max.visible.rows=10, ide.win.file.chooser.native=true, vcs.log.show.diff.preview.as.editor.tab=true, actionSystem.fix.alt.gr=false, search.everywhere.pattern.checking=false, ide.tooltip.initialDelay=0, ide.require.transaction.for.model.changes=false, ide.debug.in.title=true, rdclient.asyncActions=false
Non-Bundled Plugins: IdeaVIM
Current Desktop: ubuntu:GNOME

0
Comment actions Permalink

Daniil Shakir I get the following message when trying to open the log file - "You need access". Could you please upload the log file to the JB server via https://uploads.jetbrains.com/ form? Thanks in advance!

0
Comment actions Permalink

Maria Pleskunina Upload id: 2020_11_09_WNaYTqrwH1LF1QMs (file: 2020-11-06-18-22-28-921___28bcb5b4-0afd-4186-8777-228e18cd64ce.log)

0
Comment actions Permalink

Daniil Shakir as far as I can see, your tests target .NETStandard 2.0. However, the unit test project cannot be .NET Standard, it should target a platform: .NET Core or .NET Framework. Please take a look at https://docs.nunit.org/articles/nunit/getting-started/dotnet-core-and-dotnet-standard.html

So, please try changing netstandard2.0 to netcoreapp2.0. 

I've also submitted a new ticket to YouTrack as ReSharper should not allow such tests to be run: https://youtrack.jetbrains.com/issue/RSRP-482068

Please let me know if you have any questions. Have a great day!

0
Comment actions Permalink

Maria Pleskunina I already targeting .NET Core 3.1 but it's a multi-target project that targets .NETStandard 2.0 too.
(I'm trying to add my first unit tests in the project I'm testing because I have too much projects already)

0
Comment actions Permalink

Daniil Shakir do I understand correctly that if you choose a specific framework in Rider options, e.g., .NETCoreApp 3.1, the tests will still be Inconclusive?

0
Comment actions Permalink

Maria Pleskunina thank you!
I didn't see this option.
It works if I select ".NetCoreApp 3.1" in this select.

0
Comment actions Permalink

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.

-2
Comment actions Permalink

Здравей Ангелина,

Извинявай, но аз не съм QA на JetBrains.

Описах ви достатъчно ясно проблема.

Надявам се да го оправите, скоро, защото се влачи още от 2018.1

-2

Please sign in to leave a comment.