Hang after unit test run completed
alexangas opened this issue · comments
Hello,
I'm experiencing an issue where after as part of a unit test run, the build job appears to be doing nothing for about 10 minutes. Strangely, I have another build configuration that is working as expected, and both appear to have the same underlying XML describing their build steps. I have tried recreating the build step from scratch in the build that is hanging.
TeamCity Enterprise: 2017.1.5 (build 47175)
.NET CLI Support: SNAPSHOT-20180530085714
dotCover: 2018.2.1
.NET SDK: 2.1.401 (Visual Studio 2017 15.8.x)
Test project NuGet packages:
<ItemGroup>
<PackageReference Include="AutoFixture.Xunit2" Version="4.5.0" />
<PackageReference Include="FluentAssertions" Version="5.4.1" />
<PackageReference Include="FluentAssertions.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.10" />
<PackageReference Include="WireMock.Net" Version="1.0.2.13" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>
Thank you for any help!
@alexangas, in the latest .NET CLI versions by default enabled sharedcompilation option and it could be the cause of problems since after test session completion remains a number of dangling dotnet CLI processes which prevents dotCover termination.
Try adding the command line parameter /p:UseSharedCompilation=false
and enable checkbox "Do not build the project before testing" and check whether it solves the problem.
Thanks, i'm testing this. If "Do not build the project before testing" is ticked, does that mean I need to add a separate build step to build the test project first?
@alexangas, yes, correct, if "Do not build the project before testing" is unchecked you need to add a preceding build step with .NET CLI build
command.
I've progressively applied these changes across multiple build configurations and the issue appears to be resolved. Thanks!
Woot! Woot! I'm glad I found this. Same exact issue and same resolution. Thanks!
I couldn't get this working. But I disable code coverage and that solved the problem