-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[coverlet] Unable to instrument module for pdbs while launching tests in multiple threads #650
Comments
Is it a warning or an error?can you copy/paste full line? |
It's a warning, C:\Users\savanchuk.nuget\packages\coverlet.msbuild\2.7.0\build\coverlet.msbuild.targets(7,5): warning : [coverlet] Unable to instrument module: 'C:\Repositories\repo.git\Tests\Output\UnitTests\Server.UnitTests\Server.Views.dll' because : The process cannot access the file 'C:\Repositories\repo.git\src\Server\obj\Debug\netcoreapp2.1\Server.Views.pdb' because it is being used by another process. [C:\Repositories\repo.git\src\Server.UnitTests\Server.UnitTests.csproj] Maybe I'm missing something, but it seems that it would just skip this PDB in this case. I think the repro would be a couple of test projects that use some common dll and launch tests for these projects in parallel. I may prepare a little sample. |
Yep could be great a repro...because I did a check on codebase and we open pdbs always in read mode share read so it's strange...I'd like to understand who is locking that guy. |
Could be...there are some place that could overlap, when we talk about concurrent access without a repro it's hard to find where is the issue...if you provide a repro I could understand how to fix it or what strategy take. |
FYI I've opened some issue on msbuild repo to understand how to tackle this kind of issue...but seem that there is no great way at the moment dotnet/msbuild#4898 dotnet/msbuild#4954 You could also try to pass |
Hello, @MarcoRossignoli . I've created this repo that reproduces the problem: Launching the build.ps1 script will run dotnet test for the src\ClassLibrary\ClassLibrary.sln solution file. And I see these warnings in output: C:\Users\savanchuk.nuget\packages\coverlet.msbuild\2.7.0\build\coverlet.msbuild.targets(7,5): warning : [coverlet] Unable to instrument module: 'C:\Repositories\coverletsampleparallel\src\ClassLibrary\ClassLibrary.UnitTests3\bin\Debug\ClassLibrary.dll' because : The process cannot access the file 'C:\Repositories\coverletsampleparallel\src\ClassLibrary\ClassLibrary\obj\Debug\ClassLibrary.pdb' because it is being used by another process. [C:\Repositories\coverletsampleparallel\src\ClassLibrary\ClassLibrary.UnitTests3\ClassLibrary.UnitTests3.csproj] Code coverage result for this: Changing Code coverage is collected correctly: Thank you |
I see thank you |
@MarcoRossignoli this issue is still reproducable on coverlet.console 1.7.0.0. We get such error:
|
@tkukushkin can you open another issue please this is very old, also can you take a look if you're some antivirus active and in case shutdown for testing? |
Hello.
We collect code coverage using coverlet.msbuild version 2.7.0. We do this on Windows Server VMs and we launch our NUnit tests for a *.sln file using the "dotnet test MySolution.sln ..." command. This launches tests in parallel for every test project, and as I expect, this leads to such warnings:
'[coverlet] Unable to instrument module: C:\Repositories\myproject.git\Tests\Output\UnitTests\TerrificMethods\Core.dll' because : The process cannot access the file 'C:\Repositories\myproject.git\src\Core\obj\debug\Core.pdb' because it is being used by another process.
Because of this code coverage can change from one tests launch to another.
Thank you.
The text was updated successfully, but these errors were encountered: