Remco wrote:Could you try the build below and show me the error message it gives you? I haven't yet managed to understand this problem, so I've added some extra diagnostic details in the build to try and figure it out. For some reason, the API responsible for allocating shared memory is failing. Maybe this build will tell us why.
at first i did not realize a difference in the exception, but here it is:
System.Exception: MapViewOfFile error (size = 19514): 8
at nCrunch.TestRuntime.RuntimeSharedMemory.handlePossibleError(IntPtr handle, String apiDetails)
at nCrunch.TestRuntime.RuntimeSharedMemory..ctor(String name, Int32 bufferSizeInBytes)
at nCrunch.TestRuntime.SharedExecutionMap..ctor(ExecutionMapSpecification specification, String hostProcessId)
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.initialise()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder..ctor(ExecutionMapSpecification[] mapSpecifications)
at nCrunch.TestExecution.TestRunnerThread.()
at nCrunch.TestExecution.TestRunnerThread.()
Thanks for sharing this. The Win32 error code kicked up by the API is ERROR_NOT_ENOUGH_MEMORY. How much available memory do you have at the time the test starts running?
available memory is about 14-16GB, so should be plenty.
not sure why, but i was able to "catch" a more detailed stack trace on a failing test- maybe it helps:
System.Exception: MapViewOfFile error (size = 19514): 8
at nCrunch.TestRuntime.RuntimeSharedMemory.handlePossibleError(IntPtr handle, String apiDetails)
at nCrunch.TestRuntime.RuntimeSharedMemory..ctor(String name, Int32 bufferSizeInBytes)
at nCrunch.TestRuntime.SharedExecutionMap..ctor(ExecutionMapSpecification specification, String hostProcessId)
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.initialise()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder..ctor(ExecutionMapSpecification[] mapSpecifications)
at nCrunch.TestExecution.TestRunnerThread.()
at nCrunch.TestExecution.TestRunnerThread.()
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at nCrunch.TestRuntime.MemoryOperator.ReadUInt32Array(Int32 offset, UInt32 arraySize)
at nCrunch.TestRuntime.SharedExecutionMap.GetExecutionMap()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.PullExecutionMaps()
at nCrunch.TestExecution.ExecutingTest.Finish(Boolean isSuccess, String exceptionString, TimeSpan executionTime, Boolean writeExceptionToOutput, Boolean addExecutionTime)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.testFinished(EndTestMessage message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at nCrunch.TestRuntime.MemoryOperator.ReadUInt32Array(Int32 offset, UInt32 arraySize)
at nCrunch.TestRuntime.SharedExecutionMap.GetExecutionMap()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.PullExecutionMaps()
at nCrunch.TestExecution.ExecutingTest.Finish(Boolean isSuccess, String exceptionString, TimeSpan executionTime, Boolean writeExceptionToOutput, Boolean addExecutionTime)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.suiteFinished(EndSuiteMessage message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at nCrunch.TestRuntime.TestExecutionMap..ctor(Int32 testPositionInMasterMap, Int32 numberOfLineMarkers, Int32 numberOfClasses)
at nCrunch.TestExecution.ComponentTestExecutionMap.CreateExecutionMapForTest(TestName testIdentifier)
at nCrunch.TestExecution.TestExecutionMapSet.CreateExecutionMapsForTest(TestName test)
at nCrunch.TestExecution.ExecutingTest.Start()
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.testStarted(NUnit3Message message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at nCrunch.TestRuntime.MemoryOperator.ReadUInt32Array(Int32 offset, UInt32 arraySize)
at nCrunch.TestRuntime.SharedExecutionMap.GetExecutionMap()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.PullExecutionMaps()
at nCrunch.TestExecution.ExecutingTest.Finish(Boolean isSuccess, String exceptionString, TimeSpan executionTime, Boolean writeExceptionToOutput, Boolean addExecutionTime)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.testFinished(EndTestMessage message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at nCrunch.TestRuntime.MemoryOperator.ReadUInt32Array(Int32 offset, UInt32 arraySize)
at nCrunch.TestRuntime.SharedExecutionMap.GetExecutionMap()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.PullExecutionMaps()
at nCrunch.TestExecution.ExecutingTest.Discontinue()
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.testStarted(NUnit3Message message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at nCrunch.TestRuntime.MemoryOperator.ReadUInt32Array(Int32 offset, UInt32 arraySize)
at nCrunch.TestRuntime.SharedExecutionMap.GetExecutionMap()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.PullExecutionMaps()
at nCrunch.TestExecution.ExecutingTest.Finish(Boolean isSuccess, String exceptionString, TimeSpan executionTime, Boolean writeExceptionToOutput, Boolean addExecutionTime)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.suiteFinished(EndSuiteMessage message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at nCrunch.TestRuntime.MemoryOperator.ReadUInt32Array(Int32 offset, UInt32 arraySize)
at nCrunch.TestRuntime.SharedExecutionMap.GetExecutionMap()
at nCrunch.TestRuntime.SharedMemoryExecutionDataRecorder.PullExecutionMaps()
at nCrunch.TestExecution.ExecutingTest.Finish(Boolean isSuccess, String exceptionString, TimeSpan executionTime, Boolean writeExceptionToOutput, Boolean addExecutionTime)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.suiteFinished(EndSuiteMessage message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)
Is this a 32-bit test environment? Note that for historical reasons, NCrunch will default to 32-bit environments when running tests for assemblies that are built for AnyCPU. You can override this behaviour by forcing the test project to build to x64 or by setting the Use CPU Architecture setting.
hi and sorry for the late response.
i was able to tweak the project settings so that the issue went away. thanks for pinpointing to the AnyCPU setting.