4
votes

Our TFS 2013 server and Build server resides on two different machines, same domain. Build server has Visual studio installed on it. When I push a build, everything goes fine except that MSTest fails with following error :

TF270015: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '255'. See the build logs for more details.

The Event log shows me following error,

Faulting application name: MSTest.exe, version: 12.0.21005.1, time stamp: 0x524fbee4 Faulting module name: clr.dll, version: 4.0.30319.34014, time stamp: 0x52e0b784 Exception code: 0xc0000005 Fault offset: 0x0001bc37 Faulting process id: 0xafc Faulting application start time: 0x01cf8efc8557a612 Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Report Id: c510b7a4-faef-11e3-80d0-0026b9534e01 Faulting package full name: Faulting package-relative application ID:

The Diagnostics shows me that all the tests passed successfully and MSTest failed at the publishing-the-results-to-TFS stage :

Results file: C:\Builds\2\CommonTest\CommonQA\TestResults\tfsbuild3_WKTOBLD03 2014-06-23 12_02_24_Any CPU_Release.trx Test Settings: Default Test Settings Waiting to publish...

That's where it crashes.

I have tried pretty much everything, including,

  1. Giving permission to TFSBuild and TFSService accounts on the BuildDrops folder.

  2. Clearing TFS Cache on the server and client machine.

  3. Installing VS 2013 SP1.

Anyone has any idea as to what might be the issue here ?

2
Which version of vs do you have installed, on the build server?Just TFS
I was going to say that mstest only supports publish when installed from premium or higher. Have you tried publishing / running mstest from the build server?Just TFS
I did and it too crashed and gave the same clr related error. I tried connecting from MS test Manager too, while it connects to TFS server and show the correct project collections, when I try to connect to a project, it gives the same error.Beenish Khan
I've got a similar issue at the minute, but my VS2013 builds are fine, i have issues with VS2008 builds. when i get my issue fixed, i'll come back and let you know if it was relevant.Just TFS

2 Answers

1
votes

I had mstest.exe crash on publishing today when using TFS2013.3 on the server but only Visual Studio 2013 RTM build on the build server. Installing VS2013.3 on the build server fixed the problem for me.

1
votes

Updating to VS2013.3/TFS2013.3 didn't completely solve the issue for me. Looking at the Windows Event Log shows this error after MSTest crashes on publishing

Application: MSTest.exe 
Framework Version: v4.0.30319
Description: The process was terminated due to an internal error in the .NET Runtime at  IP 74BFAA23 (74BE0000) with exit code 80131506.

In the end I ended up moving all my test runs to the "Visual Studio Test Runner" (AgileTestPlatformSpec in the workflow) and everything worked fine. The only downside is that it requires changing all your build definitions!