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

Notification

Icon
Error

Copying large files using [DeploymentItem] is a race condition?
otac0n
#1 Posted : Saturday, March 10, 2012 12:09:41 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/22/2011(UTC)
Posts: 51
Location: Seattle, WA

Was thanked: 7 time(s) in 7 post(s)
About 50% of the time, I have tests failing, because one of our deployment items is very large.

This appears to be because copying the file takes longer than starting up the test engine, as we are getting a FileNotFound.
Remco
#2 Posted : Sunday, March 11, 2012 8:56:19 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
The copying of your resource file(s) is done synchronously with the test runner, so I think something else may be going on here.

Check that the tests using the file are not sequence dependent. If there is code specifically clearing out the file, you might find this can affect further test execution. A good way to check for sequence dependent tests is to run them using the Advanced->Run tests using existing process option. Make sure you also check that tests can be themselves run multiple times within the same process - this isn't behaviour that normal test runners do, and sometimes it can cause unexpected results.
otac0n
#3 Posted : Sunday, March 11, 2012 10:12:30 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/22/2011(UTC)
Posts: 51
Location: Seattle, WA

Was thanked: 7 time(s) in 7 post(s)
This is a very large JSON file that we are using as input and expected output for one of our tests.

However, the JSON file is being loaded in the static constructor of a class that is used in the TestInitialize method.

The file is only read from, never edited or deleted.

I'll try to get a repro case.
Remco
#4 Posted : Sunday, March 11, 2012 11:34:35 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks - if you can create an isolated reproduction that would be extremely helpful. I'm not sure if this is a problem I could solve without it.
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.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download