Hi Remco,
We are getting Exit Code 2 issues all of a sudden on some of our NCrunch Grid runs in TeamCity. We have a single controller machines which calls 3 grid nodes. In the Build Log we are seeing:
[05:05:18][Step 5/5] [05:05:19.0355-Core-5] All projects have been loaded
[05:05:19][Step 5/5] [05:05:19.6056-Core-5] Queuing 37 tests for passive execution
[05:05:19][Step 5/5] [05:05:19.9796-?-22] Ceasing to send messages because of an error (was the connection closed?): System.NullReferenceException: Object reference not set to an instance of an object.
[05:05:19][Step 5/5]
[05:05:19][Step 5/5] Server stack trace:
[05:05:19][Step 5/5] at .Write(Byte[] , Int32 , Int32 )
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.Zlib.DeflateStream.Write(Byte[] buffer, Int32 offset, Int32 count)
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.BidirectionalStream.Write(Byte[] buffer, Int32 offset, Int32 count)
[05:05:19][Step 5/5] at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
[05:05:19][Step 5/5] at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
[05:05:19][Step 5/5]
[05:05:19][Step 5/5] Exception rethrown at [0]:
[05:05:19][Step 5/5] at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.BidirectionalStream. .EndInvoke(IAsyncResult )
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.BidirectionalStream.EndWrite(IAsyncResult asyncResult)
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.GridMessageSender. (IAsyncResult )
[05:05:19][Step 5/5] [05:05:20.0046-Core-5] Connection established with remote grid node at UK-DEVBA05
[05:05:19][Step 5/5] [05:05:20.0306-?-22] Ceasing to send messages because of an error (was the connection closed?): System.NullReferenceException: Object reference not set to an instance of an object.
[05:05:19][Step 5/5]
[05:05:19][Step 5/5] Server stack trace:
[05:05:19][Step 5/5] at .Write(Byte[] , Int32 , Int32 )
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.Zlib.DeflateStream.Write(Byte[] buffer, Int32 offset, Int32 count)
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.BidirectionalStream.Write(Byte[] buffer, Int32 offset, Int32 count)
[05:05:19][Step 5/5] at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
[05:05:19][Step 5/5] at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
[05:05:19][Step 5/5]
[05:05:19][Step 5/5] Exception rethrown at [0]:
[05:05:19][Step 5/5] at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.BidirectionalStream. .EndInvoke(IAsyncResult )
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.BidirectionalStream.EndWrite(IAsyncResult asyncResult)
[05:05:19][Step 5/5] at nCrunch.Core.Grid.Connectivity.GridMessageSender. (IAsyncResult )
[05:05:19][Step 5/5] [05:05:20.0826-Core-5] Connection established with remote grid node at UK-DEVBA04
[05:05:19][Step 5/5] [05:05:20.0946-Core-5] Connection established with remote grid node at UK-DEVBA06
[05:05:21][Step 5/5] [05:05:21.9839-?-1] Reporting engine execution results
[05:05:24][Step 5/5] [05:05:24.4353-?-1] Shutting down engine
[05:05:41][Step 5/5] [05:05:41.97-?-1] Returning result: TestFailure
[05:05:42][Step 5/5] Process exited with code 2
[05:05:43][Step 5/5] Step Rerun failed tests using NCrunch grid (Command Line) failed
The issue seems intermittent in the sense it doesn't always happen. Maybe 1 in 3 times or something right now. Any ideas?