mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 10:07:55 +08:00
Fix memory leak when running SpecFlow tests
As a workaround for nunit reporting obscure AppDomainUnloadedException, update the .config file to disable lagacy exception handling policy. --HG-- branch : dev
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
<runtime>
|
<runtime>
|
||||||
<loadFromRemoteSources enabled="true" />
|
<loadFromRemoteSources enabled="true" />
|
||||||
<!-- We need this so test exceptions don't crash NUnit -->
|
<!-- We need this so test exceptions don't crash NUnit -->
|
||||||
<legacyUnhandledExceptionPolicy enabled="1" />
|
<legacyUnhandledExceptionPolicy enabled="0" />
|
||||||
|
|
||||||
<!-- Look for addins in the addins directory for now -->
|
<!-- Look for addins in the addins directory for now -->
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Web;
|
||||||
using System.Web.Hosting;
|
using System.Web.Hosting;
|
||||||
|
using Orchard.Specs.Hosting.Orchard.Web;
|
||||||
|
|
||||||
namespace Orchard.Specs.Hosting {
|
namespace Orchard.Specs.Hosting {
|
||||||
public class WebHostAgent : MarshalByRefObject
|
public class WebHostAgent : MarshalByRefObject
|
||||||
@@ -11,11 +14,7 @@ namespace Orchard.Specs.Hosting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Shutdown() {
|
public void Shutdown() {
|
||||||
//TODO: this line is required to properly shutdown the ASP.NET
|
HostingEnvironment.InitiateShutdown();
|
||||||
// host and release memory when running multiple SpecFlow tests.
|
|
||||||
// However, nuint complains about an unhandled AppdomainUnloadedException
|
|
||||||
// When we figure out a way around this, we will re-enable this line.
|
|
||||||
//HostingEnvironment.InitiateShutdown();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user