Open ulrichb opened 4 years ago
Hi i Have same problem. I'm create ApiTests project with Nunit tests for custom class methods. Tests successfully run. Then create UnitApiTestsService project which use ApiTests.dll like:
var dockerEnvironment = Environment.GetEnvironmentVariable("DOCKER_UNIT_TEST_ENVIRONMENT")=="TRUE" ? true : false;
var info = new ProcessStartInfo
{
FileName = "dotnet",
//Arguments = "vstest ../ApiTests/bin/Debug/netcoreapp2.2/ApiTests.dll",
//Arguments = "vstest ApiTests.dll",
Arguments = dockerEnvironment ? "vstest ApiTests.dll" : "vstest ../ApiTests/bin/Debug/netcoreapp2.2/ApiTests.dll",
UseShellExecute = false,
RedirectStandardOutput = true
};
_shedulerProcess = Process.Start(info);
var testResults = _shedulerProcess.StandardOutput.ReadToEnd();
_shedulerProcess.WaitForExit();
dockerEnvironment
is true
Service runned by message from RabbitMQ. Locally all succesfully work, but when i put UnitApiTestsService in docker image, after start this image i have same throuble on line Process.Start(info);
with this text:
vstest.console process failed to connect to testhost process after 10000 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout. Test Run Aborted.
when container work, service successfully receive message from Rabbit.
anybody might solve this trouble?
@kertak90 The VSTest adapter should not impact on tests runs. Try adding the argument /Diag:[file name]
to get details. Also try removing the adapter and repeat tests run without it.
i have the same problem. With version 1.0.17 it works!
My observation:
TeamCity.VSTest.TestAdapter
package ref + clean build: test runs fineAfter adding TeamCity.VSTest.TestAdapter
v1.0.20:
Error with vstest.console process failed to connect to testhost process after 90 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout.
BUT: The output appears immediately (no 90 secs. wait). Also set VSTEST_CONNECTION_TIMEOUT=1000
makes no difference.
I found a potential problem in the attached log:
TpTrace Warning: 0 : 15152, 6, 2020/03/18, 13:10:47.296, 889890365818, vstest.console.dll, ProxyOperationManager: Failed to end session: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestSender.EndSession() at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.Close()
Unfortunately cannot reproduce. Can someone share a minimal test project to reproduce?
Can someone share a minimal test project to reproduce?
.. I will try.
Is it possible that the problem is that I'm using .NET Core 2.2? I'm asking because one of the changes of 1.0.18 is this dependencies update: https://github.com/JetBrains/TeamCity.VSTest.TestAdapter/commit/b1d1a6c22f727c753766627bf7b7ace5e96b267d ... where Microsoft.NET.Test.Sdk
changed from version 15 to 16.
@txs-lars: Do you also use .NET Core 2.x?
Can someone share a minimal test project to reproduce?
.. I will try.
Is it possible that the problem is that I'm using .NET Core 2.2? I'm asking because one of the changes of 1.0.18 is this dependencies update: b1d1a6c ... where
Microsoft.NET.Test.Sdk
changed from version 15 to 16.@txs-lars: Do you also use .NET Core 2.x?
I use .Net Core 3.1
I get the same Error both in VS2019 and VS2017, across all solutions when trying to run tests. Tried to change Platform target(x64) as per some suggestions, clear cache, add MSTest.TestFramework nuget, yada yada yada. Nothing worked.
Log level is set to Informational (Default). Test data store opened in 0,016 sec. [2020-04-08 5:30:27.824 ] ---------- Discovery started ---------- Microsoft.TestPlatform.VsTestConsole.TranslationLayer.TransationLayerException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\ServiceHub\Hosts\ServiceHub.Host.CLR.AnyCPU\ServiceHub.TestWindowStoreHost.exe process failed to connect to vstest.console process after 90 seconds. This may occur due to machine slowness, please set environment variable VSTEST_CONNECTION_TIMEOUT to increase timeout. at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.WaitForConnection() at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.EnsureInitialized() at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.InitializeExtensions(IEnumerable
1 pathToAdditionalExtensions)
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformProvider.
How did you run tests? I mean .NET TeamCity runner or scripts?
Try updating test SDK 'Microsoft.NET.Test.Sdk' to latest version for test projects
@NikolayPianikov Updating VS made it work, weird issue. Thanks for the comment though.
After updating to 1.0.18, I got the following errors in the TC run.
.NET Core Version: 2.2