Dotnet CLI, dotCover, XUnit: tests wait for about 10 minutes before finish
TC 2017.2.4 (build 51228)
I've setup dotnet CLI step "dotnet test" with dotCover enabled.
Tests take several seconds, compilation is about 1 minute, but when I run the build configuration it takes minimum 10 minutes to finish.
I see in the log that tests are finished, but there are about 10 minutes delay until the build config finishes.
If I cancel the build, it shows as "Cancelled" (red color) but then anyway waits 10 minutes to finish the run.
Please sign in to leave a comment.
How many tests do you have in your setup? TeamCity might need some time picking up all the results if the amount is very large. Could you try running the steps manually in the build agent's machine with the user that runs the teamcity service and see whether the behavior is the same?
Amount was about 3-4 tests.
I have idea that adding "--no-build" may fix the issue.
Am I right that running dotCover for "dotnet test" without --no-build will wait for dotnet.exe process to finish?
What if it does not finish immediately (I believe they may keep some processes running after tests finished) ?
Yes, also you could build and run tests for your project in different steps as you suggested:
dotnet build
dotnet test --no-build
It should help. Another workaround is to specify the environment variable UseSharedCompilation=false for build configuration (or just an additional argument /p:UseSharedCompilation=false). The issue might be because of some of build's infrastructure processes are remaining in memory after a build (for build time optimization), but dotCover is waiting for finishing of all spawned processes.
These processes will be filtered by dotCover itself in the future but I've created issue https://github.com/JetBrains/teamcity-dotnet-plugin/issues/132 for dotNet CLI plugin
Sorry for inconvenience