Error discovering tests
JamesNK opened this issue · 12 comments
Error in VS2015 Output window. Using beta 6.
No tests are shown in Test Explorer window.
------ Discover test started ------
------ Test started: Project: Newtonsoft.Json.Tests ------
Starting Microsoft.Framework.TestHost [C:\Users\James\.dnx\runtimes\dnx-coreclr-win-x86.1.0.0-beta6\bin\dnx.exe --appbase "C:\Development\Source\Json\Newtonsoft.Json\Src\Newtonsoft.Json.Tests" Microsoft.Framework.ApplicationHost --port 50440 Microsoft.Framework.TestHost --port 50629]
Connected to Microsoft.Framework.TestHost
Discovering tests in 'C:\Development\Source\Json\Newtonsoft.Json\Src\Newtonsoft.Json.Tests\project.json'
Error discovering tests in 'C:\Development\Source\Json\Newtonsoft.Json\Src\Newtonsoft.Json.Tests\project.json'\r\nSystem.Exception: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
at Microsoft.VisualStudio.Web.UnitTest.TestAdapter.Discovery.HostExtensions.GetTests(IHost host, ITestCaseDiscoverySink discovery, IMessageLogger logger, KRuntimeConfiguration testConfiguration)
at Microsoft.VisualStudio.Web.UnitTest.TestAdapter.KUnitTestDiscoverer.GetTestCases(IEnumerable`1 sources, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
========== Discover test finished: 0 found (0:00:16.2319284) ==========
I tracked this down to a bug I added to Json.NET while making changes. The test host uses Json.NET so my bug took down the host when it encountered the bug.
So no bug in the host but I think you should add more error handling so it doesn't crash so badly and pass the error message back to VS. That will help the user a better idea of what has gone wrong.
@JamesNK do any released versions of Json.NET contain the bug? For example are "Newtonsoft.Json": "6.0.6"
through ... "6.0.8"
fine while ... "7.0.1"
has this problem and ... "7.0.2"
will be fine again?
No, it was from wip dev changes. Testing Json.NET is slightly difficult if the change I make during dev breaks the test application 😄
@rynowak we do have our super simple JavaScript serializer/deserializer... or actually I don't know if we have a serializer; we may have only put in a deserializer...
yeah, that would be good as well, we should remove json.net as a dependency as possible so you can use whatever version you want
If we want to do this I'd have to go dig up my old source codez to find the missing features.
Created a bug in tooling repo (aspnet/Tooling#129) to track 'removing the json.net dependency' from VS unit test adapter.
@JamesNK - do you happen to know offhand what the callstack was that throwing?
That's all the error message says. You should include more detail to VS when an error is thrown:
yeah, that would be good as well, we should remove json.net as a dependency as possible so you can use whatever version you want
You already can. The test tools were using my dev version which had a bug which is why I got that error.
This issue was moved to aspnet/Tooling#183