Comments (5)
I get the same result when running my tests of my project as well.
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="Microsoft|testhost|NUnit3.TestAdapter|AltCover.Monitor|GreenFeetWorkFlow.Tests"
works
from altcover.
This is an unfortunate effect of the way that, on Windows, at least, file locks can take some appreciable time to release even after the process that took them out has exited, so the dotnet test
script takes a back-off and retry approach when it encounters such a lingering lock.
What is going on is that with the --inplace
option, the as-built files are saved away, and instrumented files, including the generated recorder assembly are placed in the build target directory. The dotnet test
script runs the test, runs the coverage collection (which involves reading the location of the coverage report from the recorder), then goes to restore the target directory to the original state, copying back the uninstrumented files and deleting the added recorder assembly - and it's this last step that's causing the observed behaviour.
Changes that can be made would be cosmetic - not just echoing the exception message, but putting out something more anodyne; and increasing the retry frequency.
from altcover.
The message is emitted only after a number of attempts have failed; so I've added some mitigations - tightening the scope of the use of the recorder file, so the locks will be released sooner, increasing the frequency of retries, and finally replacing the exception message with a more informational Failed to delete file [name]
.
from altcover.
Release 8.8.21 mitigates the likelihood of the issue, and improves the resulting error message if the file cannot be promptly deleted.
from altcover.
Assuming sufficiently resolved.
from altcover.
Related Issues (20)
- MSBuild Tasks Support for Multi-Targeting Test Projects HOT 4
- Coverage file having complete build path in it for files causing issue while merging multiple coverage files together HOT 3
- Microsoft.NET.Test.Sdk 17.8.0 support HOT 7
- [enhancement] integration with xharness and/or device runners for iOS and Android HOT 2
- help with getting started HOT 2
- Path.GetFullPath no longer resolves long file paths HOT 7
- Could not find coverage.xml.zip when running Instrumented binaries HOT 5
- Adding AltCover to projects results in dotnet test running against all projects in solution HOT 6
- Running AltCover Runner in parallel mode HOT 2
- Question about cyclomatic complexity for pattern match HOT 2
- Changes so AltCover will run when FIPS compliance is required HOT 13
- .../Temp/tmp###.altcover.runsettings not found Intermittent tests ignored. HOT 2
- BranchPoints differ between .NET Framework and .NET 7 when using interpolated strings HOT 5
- Question Regarding assemblies being added to code coverage result HOT 2
- Command vstest.console.exe not started. Why? HOT 3
- altcover runner --OutputFile gives incorrect summary output HOT 8
- ERROR *** Instrumentation phase failed - Failed to resolve assembly: System.Data.Common HOT 8
- Generic methods share the same name and signature HOT 5
- Collection phase failed with an Error HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from altcover.