Open alewkowicz opened 7 years ago
I fixed this running Visual Studio as Administrator
I get this too sometimes. The root cause seems to be environmental I think, because when we run our tests connected to the network at the office through VS test runner, it takes about 15 seconds for the tests to actually start. Disconnecting from the network seems to remove this delay immediately.
This leads me to believe it might be AxoCover timing out the service creation.
Whenever this happens, I just try running it again until it works, which it usually does within the next 3 tries.
Service timeout is 20 seconds right now. This timeout is before the runner is ready to execute the tests. The runner listens to the UI at a random TCP port on loopback device (127.0.0.1).
Can you check if the runner (AxoCover-Host) crashes in the windows application event log? It should also provide a stacktrace there if it crashed.
Unfortunately I cannot reproduce this problem, but if you have some time I can give you information on how to debug it. Until that I can improve telemetry in regards to this, since it was not providing enough info to fully understand / reproduce the problem so far.
I am suspecting that a firewall or antivirus might interfere with the communication with the runner. I have made a build which uses NamedPipes instead of TCP based communication. Can you try it?
It is here.
Unfortunately, I can't try it, as I am no longer working at the client site where I experienced the problem. I don't have a copy of the source code for that project. Nor do I have access to that desktop machine, as it belonged to the client.
Perhaps @riccardone or @biltongza could try it?
Thank you for working on the problem!
Tried it, still the same issue.
Test execution failed.
SerializableException: Service creation timed out.
at AxoCover.Models.TestProcess`1..ctor(IProcessInfo processInfo) in C:\projects\axotools\AxoCover\Models\TestProcess.cs:line 31
at AxoCover.Models.ExecutionProcess.Create(String[] testPlatformAssemblies, IHostProcessInfo hostProcess, TestPlatform testPlatform) in C:\projects\axotools\AxoCover\Models\ExecutionProcess.cs:line 28
at AxoCover.Models.AxoTestRunner.RunTests(TestItem testItem, Boolean isCovering, Boolean isDebugging) in C:\projects\axotools\AxoCover\Models\AxoTestRunner.cs:line 86
at AxoCover.Models.TestRunner.<>c__DisplayClass31_0.<RunTestsAsync>b__0() in C:\projects\axotools\AxoCover\Models\TestRunner.cs:line 53
Running the coverage test again immediately afterwards worked. I'll continue trying to see what happens to get you some more results.
Do you have a case where only the first case fails, but it tends to be work after. Maybe a slow HDD or antivirus could be the source of the problem?
Also I see a failed runner start for a user in telemetry in the last hour, however it still uses TCP. Are you sure you use the right version? Do you have telemetry enabled?
I'm sure it's the right version, build 1.1.271. I have telemetry enabled, but I'm not sure if it was enabled when I ran that test last time.
That said, I just started a coverage run from a cold start of my machine this morning, and it worked first time.
I don't think it's HDD related, since I'm on an SSD. I could believe antivirus being the source of the issue, but I can't test it because we can't disable the AV (corporate policy).
I'll be honest I don't know if there is a "fix" for this as I think it's environmental, but it would be nice if I could configure the service creation timeout period and see if I can work around it like that.
Ok, I think I will add some developer options, namely:
Hopefully this will help to understand the issue.
I have added the following features to help us figure out the issue:
So, I took the new release to work today expecting to come home with a better error message about why coverage wasn't working.
Coverage works fine now.
:/
The "Could not create service" exception resurfaced today. The new "Debug" option did not provide any new messages in the Output window.
Still getting this issue. Debug mode is enabled but I'm not getting any extra information in the output window. Telemetry is enabled so you might be able to see more than I can. Increasing the startup timeout from 20 seconds to 60 seconds seems to have helped, though.
I've also go this issue in VS 2017. I've increased the startup and debugger timeouts to 120 but it hasn't had any effect.
I've also enabled debug mode but I'm not seeing any additional output in the output console either.
Hi,
I think, the issue might be related to the settings. For example, when I set the "Exclude directories" to "D:\mysource\mystuff\mymodule\" then the "Cover tests" action fails (immediately, so the timeout thing is ignored). When I set it to "\mystuff\mymodule" (I removed not just the "D:\" but the last backslash as well) then the "Cover tests" action started to work again.
I hope it helps:).
FWIW, I had the "Could not create service." error as well. Turned out it was related to a Test Project assembly's name containing whitespace. When I renamed the Test Project's assembly, the error disappeared.
Got this exception when I had these filters in the settings.json:
"Filters": "+[Some.Namespace.*]* -[Some.Namespace.*.Test]*\"",
instead of these:
"Filters": "+[Some.Namespace.*]* -[Some.Namespace.*.Test]*",
Notice the one little quote at the end of the first line.
This bug is definitely related to whitespace and quotation marks in settings entries
This appears to be causing issues when sending args to opencover console.exe
https://github.com/opencover/opencover/wiki/Usage
I haven't dug around in the code enough to figure out exactly where the issue is - but any kind of quotes in the exclude values will cause the serializableexception to fail
But not using quotes means you can't ignore anything with spaces apparently
I'm getting an error in the AxoCover Output window pane when I click the Cover option in the header bar, the Cover tests option in the context menu, or build with "Cover after every build" turned on (via the Context menu).
Please let me know what additional information you would like. AxoCover is a great tool and I'm glad to have found it!
Here's the contents of the Output window pane:
The Build version is 1.1.244 per the Settings window. The last check for updates was today.
Microsoft Visual Studio Professional 2017 Version 15.2 (26430.16) Release VisualStudio.15.Release/15.2.0+26430.16 Microsoft .NET Framework Version 4.6.01590
Installed Version: Professional
I have telemetry turned ON for AxoCover.