coverlet: Test's not working when using Coverlet Collector
Hi,
I’m trying to use the coverlet collector and it does not exit the tests. I have 85 tests that take about 35 seconds to run. But when I run dotnet test --collect:"XPlat Code Coverage" it runs forever I have to manually close the process. Coverlet is working fine.
The project is in dot net 5.0.
Coverlet output Calculating coverage result… Generating report ‘ERP.Service.xUnit.Test\coverage.json’ ±------------------------------±-------±-------±-------+ | Module | Line | Branch | Method | ±------------------------------±-------±-------±-------+ | ERP.Core | 38.81% | 3.19% | 19.8% | ±------------------------------±-------±-------±-------+ | ERP.Infrastructure | 0% | 0% | 0% | ±------------------------------±-------±-------±-------+ | ERP.Repositories | 20.28% | 24.1% | 34.23% | ±------------------------------±-------±-------±-------+ | ERP.Services | 38.02% | 23.25% | 32.46% | ±----------------------------±-------±-------±-------+ | ERP.Services.xUnit.Test | 99.82% | 90.62% | 99% | ±------------------------------±-------±-------±-------+
±--------±-------±-------±-------+ | | Line | Branch | Method | ±--------±-------±-------±-------+ | Total | 0.1% | 20.65% | 19.06% | ±--------±-------±-------±-------+ | Average | 39.38% | 28.23% | 37.09% | ±--------±-------±-------±-------+
Output for dotnet test --collect:“XPlat Code Coverage”
Starting test execution, please wait… A total of 1 test files matched the specified pattern.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 33
I definitely would not lose sleep over it unless you want a huge challenge. Software should not be designed this was in 2021!
I’m migrating the code to Clean Acrutature so everything should have its own service class exposed by an interface. Done 5k lines 95k more to go
The web project is full of static references tends of thousands. If you build on an Intel i5 the build time is 30 minutes
Which version of coverlet are you using?Can you zip and send logs also fordotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=coberturasame diag config.Not needed…looks like it hangs on collector during report generation…but from logs isn’t possible understand where it stucks we need to get a dump.
In log.datacollector.21-11-06_13-48-31_56943_5.txt after hit file deletion(second to last line) we expect generation of file but it stucks until parent process exits(I think when you stop with ctrl+c on console).
You should run the test and when it hangs(some seconds) you should find a process called datacollector.exe as child of dotnet.exe that is the process for which to take the dump. After you should open in VS and take a look at stacks.
A normal log should be something like
in your case