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

Notification

Icon
Error

Compatibility issue with RavenDB 3.0 [Solved]
yanglee
#1 Posted : Wednesday, December 10, 2014 1:53:57 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
Hello, I upgraded RavenDB from version 2.5 to 3.0. I can compile and run my software without problem. But I get lots of exceptions with my tests under NCrunch.

I set both "Allow parallel test execution" and "Allow tests to run in parallel with themselves" of the solution to "False", and executed "Resynchronize, rebuild and run all tests" command (also tried restart Visual Studio), but same issue.

Any ideas?

Code:
SetUp : System.IO.IOException : The process cannot access the file 'M:\NCrunch\Workspace\8828\54\_ncrunchreferences\Assemblies\Lucene.Net.dll' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.IO.File.Delete(String path)
   at Raven.Database.Server.AssemblyExtractor.Extract(Assembly assemblyToExtractFrom, IEnumerable`1 assembliesToExtract, String location) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\AssemblyExtractor.cs:line 89
   at Raven.Database.Server.AssemblyExtractor.ExtractEmbeddedAssemblies() in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\AssemblyExtractor.cs:line 37
   at Owin.AppBuilderExtensions.UseRavenDB(IAppBuilder app, RavenDBOptions options) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\AppBuilderExtensions.cs:line 70
   at Raven.Database.Server.OwinHttpServer.<.ctor>b__0(IAppBuilder app) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\OwinHttpServer.cs:line 26
   at Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp(StartContext context)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
   at Raven.Database.Embedded.OwinEmbeddedHost.Configure(Action`1 startup, StartOptions options) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Embedded\OwinEmbeddedHost.cs:line 65
   at Raven.Database.Server.OwinHttpServer..ctor(InMemoryRavenConfiguration config, DocumentDatabase db, Boolean useHttpServer, Action`1 configure) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\OwinHttpServer.cs:line 26
   at Raven.Server.RavenDbServer.Initialize(Action`1 configure) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\RavenDbServer.cs:line 106
   at Raven.Database.Client.EmbeddedDocumentStore.Initialize() in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Client\EmbeddedDocumentStore.cs:line 225
   at Raven.Client.Embedded.EmbeddableDocumentStore.Initialize() in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Client\EmbeddableDocumentStore.cs:line 134
Remco
#2 Posted : Wednesday, December 10, 2014 3:46:29 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi, thanks for sharing this issue.

There's likely to be a lot going on here, so I'm afraid that I'm reduced to blind guessing on this one. The first thing that gets my attention is the directory the file is located in:

M:\NCrunch\Workspace\8828\54\_ncrunchreferences\Assemblies

NCrunch doesn't usually copy referenced assemblies into an 'Assemblies' directory - they are normally directly under _ncrunchreferences. This suggests to me that the file lock is probably being held by the test code (or production code it is calling into). Is it possible that RavenDB is trying to initialise itself multiple times in the same location without a cleanup step? The difference here between NCrunch and another test runner could be that NCrunch can call multiple times into the test process while other test runners will only call into the test process once.

I would suggest trying to find out where the lock on this file is being established and see whether this is in an AssemblyInitialize method of some kind or code that is likely to be repeatedly called by NCrunch in a re-used test process.
1 user thanked Remco for this useful post.
yanglee on 12/10/2014(UTC)
yanglee
#3 Posted : Wednesday, December 10, 2014 7:10:42 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
I tried again, and found actually setting "Allow parallel test execution" to False solved the issue. It didn't work previously probably because I set Engine Mode to "Run impacted tests automatically, others manually", and somehow the settings were not updated.

I tried adding "IsolatedAttribute" to all theses tests but still same issue (when "Allow parallel test execution" is True). I can get all tests past by executing "Run all tests visible here" multiple times.

Thanks for the suggestion, will report back when I find something new.
1 user thanked yanglee for this useful post.
Remco on 12/10/2014(UTC)
Remco
#4 Posted : Wednesday, December 10, 2014 7:32:31 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Thanks - I guess the DB doesn't work well with the parallelisation .. Do also let me know if you find a way to reproduce the issue where changing this setting didn't take affect, as this does also sound like a problem to me.
yanglee
#5 Posted : Monday, February 9, 2015 5:14:35 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
Updating RavenDB from version 3.0.3528 to the latest version 3.0.3599 solved the issue :)
1 user thanked yanglee for this useful post.
Remco on 2/9/2015(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.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download