Tuesday, 15 May 2012

activerecord - After upgrading to Castle Trunk and NHibernate 2.1.0.4000 My Integration tests crash TestDriven.Net -


I have an old mono rail / activivercard, I am also doing some work.

Recently I decided to upgrade the application to Castle Trunk & amp; NHibernate 2.1.0.4000 GA and now I am searching for some issues with running tests:

First of all - when using TestDriven.Net to run integration tests that work against the database, this TestDriven .NET is completely crashing, or all test completes execution, then TestDriven.Net hangs up. This upgrade has never happened before

TestDriven.Net crashes, here's what the event is written to log when.

Defect Bucket 1467169527, Type 1 Event Name: Appcrash Answer: Not Available Taxi Number: 0

Problem Signature: P1: ProcessInvocation86.exe P2: 2.22.2468.0p 3: 4a26845c P4: KERNELBASE.dll P5: 6.1.7600.16385 P6: 4a5bdbdf P7: e053534f P8: 0000b727 Second thing - when the proxy class is finally being () 'D', exceptions are being logged then - It seems that when it is logged twice, it is when TestDriven.Net accidents

here is the stack trace for the exception.

NHibernate.LazyInitializationException: Getting Started [MyApp.Core.Models.TestExecutionPackage # 15d9eb96-faf0- 4b4b-9c5c-9cd400065430] - Could not start the proxy - No session. Start at NHibernate.Proxy.AbstractLazyInitializer.In () at NHibernate.Proxy.AbstractLazyInitializer.GetImplementation) NHibernate.ByteCode.Castle.LazyInitializer.Intercept (IInvocation invocation) in Castle. Dynamic proxy. In the castle Proxies Execute Test Execution Packaging Proxies ()

The same behavior will crash MSBill on our CI server too.

What's really strange is that the principle thrown in the finals should be swallowed in exceptions according to MSDN Docs:

If last or override finally throws an exception, the runtime ignores the exception

= "lesson">

Never got enough of this issue, but I made almost a simple task by creating my own Azmi Lazy Initializer implementation Second was finished then I check the final method on the invoice, as shown below:

  /// & lt; Summary & gt; Try the actual property / method using the /// proxy or use the real / T object immediately and can not operate the proxy method. /// & lt; / Summary & gt; /// & lt; Param name = "invocation" & gt; & Lt; See cref = "IInvocation" /> From the generated castle Dynamic Proxy & Lt; / Param & gt; Public Virtual Zero Blocking (Try IInvocation Orientation) {Try (invocation.Method.Name == "Finalize") {Return;} If (_constructed) {// Normal LazyInitializer can detect it if it can be handled / To begin with / proxy or start the actual class invocation. Return = base.Invoke (invocation.Method, invocation.Arguments, Invocation needs .Proxy); // Base LazyInitializer can not meet it so we can not complete the actual class (Invocation.ReturnValue == InvokeImplementation) {invocation.ReturnValue = invocation.Method.Invoke (GetImplementation) (), // Law / Property needed to invoke against invocation.) Logic; return;} and {return;}} Else {// TODO: Find the equivalent of 'method.invokeSuper' of CGLIB; Return;} } Catch (target invocation exception tie) {// Promote internal exception so that the exception to the proxy can be thrown in as //. Real object exceptions_expression StackTrace.Invoke (tie.InnerException, new object [] {}) ; Throw tie. Inner exposure; }}  

No comments:

Post a Comment