Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

File locking prevents a test from running
angyan
#1 Posted : Friday, June 23, 2017 5:25:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/23/2017(UTC)
Posts: 2
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I am getting this error: The process cannot access the file '<Path>' because it is being used by another process. I assume that this is because of the parallel nature of NCrunch? How do I run unit tests that all try to load up a a single test file?
Remco
#2 Posted : Friday, June 23, 2017 9:24:45 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting.

This documentation page describes the parallel execution behaviour in detail, along with ways in which you can control it.
1 user thanked Remco for this useful post.
angyan on 7/5/2017(UTC)
johanohrn
#3 Posted : Wednesday, July 5, 2017 8:36:52 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/2/2017(UTC)
Posts: 8
Location: Sweden

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
If you have control of the read operation I suggest you change it so that it does not exclusively lock the file. That way other threads/processes are free to read it in parallel.
1 user thanked johanohrn for this useful post.
angyan on 7/5/2017(UTC)
angyan
#4 Posted : Wednesday, July 5, 2017 2:58:59 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/23/2017(UTC)
Posts: 2
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I was able to get it working. I actually was not closing the file as well after reading it and once I fixed this, the tests work well.
1 user thanked angyan for this useful post.
Remco on 7/5/2017(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download