question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: File locking

See original GitHub issue

My coverage script does the following:

...
# Run the tests
    for testproj in $(ls tests/*.Tests -d | grep -v Integration); do 
        echo ${testproj}; 
        set +e
        time \
            dotnet test \
                --no-build \
                --no-restore \
                --filter "TestCategory!=Integration" \
                --logger:trx \
                -r ${base_dir}/.output/ \
                $testproj \
                /nowarn:NU1701,NU1603,NU1605 \
                /p:CollectCoverage=true \
                /p:CoverletOutputFormat=opencover
        cname=$(basename $testproj)
        cp ${testproj}/coverage.xml ${base_dir}/.output/$cname-coverage.xml
        set -e
    done
...

This works perfectly well for the most part, but I see the following error randomly in different parts of the output on each run:

...
Total tests: 18. Passed: 18. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 4.4549 Seconds
Results File: /tmp/build/5128ae76/.output/_161d9565-a576-4c2a-7fe5-1bb0ae8a6598_2018-04-04_12_54_05.trx

Calculating coverage result...
/tmp/build/5128ae76/source-code-core/packages/coverlet.msbuild/1.0.3-beta1/build/netstandard2.0/coverlet.msbuild.targets(19,5): error : The process cannot access the file '/tmp/build/5128ae76/source-code-core/tests/Diagnostics.Tests/bin/Debug/netcoreapp2.0/MyAssemblyDependency.dll' because it is being used by another process. [/tmp/build/5128ae76/source-code-core/tests/Diagnostics.Tests/Diagnostics.Tests.csproj]

real	0m6.404s
user	0m2.980s
sys	0m0.280s
cp: cannot stat 'tests/Diagnostics.Tests/coverage.xml': No such file or directory

Any ideas?

Cheers, Paul

NB: coverlet-1.0.3-beta1 is a build of the current master so as to capture the change from PR #23 and hosted in a local nuget repo.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sampwilcommented, Apr 9, 2018

@pms1969 Will do. I will try to put on the schedule for today.

0reactions
pms1969commented, Apr 9, 2018

@sampwil would you be able to test that PR and see if you still get the issue. Looks like it worked locally for me, but it’s always hard to tell if it has actually resolved in cases like this. I’m having some unrelated other system issues as well, so confirmation from another source would be desirable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

File locking bugs
Basically, your file locking system is screwing up my NAS so that Office is completely unusable. Please tell me how to STOP FILE...
Read more >
File locking
File locking is a mechanism that restricts access to a computer file, or to a region of a file, by allowing only one...
Read more >
What exactly is File Locking? : r/antivirus
The locking happens because the Anti-virus service opens the file to be scanned in a separate thread, and then another scanner process also ......
Read more >
[BUG?] locking doesn't stop changes or lock files - Feedback
Locking prevents only editing the contents of the file, metadata can still be changed. APC March 15, 2022, 4:13pm 3.
Read more >
Google Chrome fixes antivirus 'file locking' bug on ...
Google has fixed a Chromium bug to prevent antivirus programs running on Windows 10 from blocking new files and bookmarks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found