Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vstest.executionengine.exe crahed on TFS, but on my local VS2012 all ok

When I run test on TFS server I got the following error:

The active Test Run was aborted because the execution process exited unexpectedly. To investigate further, enable local crash dumps either at the machine level or for process vstest.executionengine.exe. Go to more details: [http://go.microsoft.com/fwlink/?linkid=232477]

When I run this tests on local machine, I got "All Passed" result. I do not know what could be the reason and what is the difference between the tests are run on the TFS server and locally?

like image 703
user1261129 Avatar asked Feb 05 '14 07:02

user1261129


2 Answers

We had the same problem in one of our CI builds. The reason was that one (or more) tests were starting separate threads and when a crash occurs in such thread and not in the main thread of vstest.executionengine the process simply crashes without additional information. Enabling the crash dump as suggested in the error message helped us localize the problematic module. Another approach was to start removing test assemblies from the build definition so that we're running only part of the unit tests until we localize the problematic test.

The difference between the local environment and TFS is the different folder structure that the build server creates compared to the local, so some relative paths become wrong. Exactly in our situation we were missing some data files. We had both forgotten to map them in the "Source settings" path of the build definition and forgotten to deploy them properly.

like image 186
Velimir Avatar answered Sep 29 '22 14:09

Velimir


Today we have faced same exception:

Run Visual Studio Test Runner for Test Sources The active Test Run
was aborted because the execution process exited unexpectedly. To
investigate further, enable local crash dumps either at the machine
level or for process vstest.executionengine.exe. Go to more details:
http://go.microsoft.com/fwlink/?linkid=232477 Test Run Completed. 0
tests executed. Test Run Failed.

All unit test case are aborted. We don't know why and which test case caused the crash.

We have followed "Collecting User-Mode Dumps" to configure tfs build server to collect dumps file for the issue.

And use DebugDiag to analysis dump file. And at last we find out the root cause.

Root cause is that one unit test case call following method and result thead locks:

[[PrestubMethodFrame] (System.Messaging.Interop.SafeNativeMethods.IntMQPathNameToFormatName)] System.Messaging.Interop.SafeNativeMethods.IntMQPathNameToFormatName(System.String, System.Text.StringBuilder, Int32ByRef) System.Messaging.Interop.SafeNativeMethods.MQPathNameToFormatName(System.String, System.Text.StringBuilder, Int32 ByRef)+1c System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath(System.String, Boolean)+154 System.Messaging.MessageQueue.Exists(System.String)+ea

like image 30
Amitabha Avatar answered Sep 29 '22 13:09

Amitabha