locked
UnitTestAdapter throws IOException for all tests RRS feed

  • Question

  • We have an automated system for running our unit tests using MSTest.  Recently all our managed unit tests started failing.  The error in the .trx file was just "The file exists.".  After configuring the agent to write to log file I could see the following stack trace for an IOException.  It seems the adapter is trying to create a temporary config file for my test assembly and is getting the IOException because it already exists.  However it does not exist.  Just to see what happened I created a proper config file for my assembly and placed it in same directory but I still received same exception.  Any ideas what could be causing this?


    System.IO.IOException: The file exists.

       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
       at Microsoft.VisualStudio.TestTools.Execution.ResolutionAppDomainHelper.GetTempAppConfigFile()
       at Microsoft.VisualStudio.TestTools.Execution.ResolutionAppDomainHelper.GetAppDomainSettings()
       at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.CreateAppDomain(String codeBase)
       at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.GetInfoForAssembly(UnitTestElement test, Boolean isLoadTest)
       at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.Run(ITestElement testElement, ITestContext testContext, Boolean isLoadTest)
    V, 4428, 14, 2018/08/01, 10:28:20.421, MCSTEST30\QTAgent_40.exe, 
    Wednesday, August 1, 2018 5:51 PM

Answers

  • Hi,

    Try clean C:\Windows\Temp and %temp% folder for current logged in user on machine where tests are running.


    Thanks,
    Vivek Bansod
    Blog | MSDN | LinkedIn
     

    • Marked as answer by Ed Waite Wednesday, August 8, 2018 4:43 PM
    Tuesday, August 7, 2018 9:27 AM

All replies

  • Hi,

    Try clean C:\Windows\Temp and %temp% folder for current logged in user on machine where tests are running.


    Thanks,
    Vivek Bansod
    Blog | MSDN | LinkedIn
     

    • Marked as answer by Ed Waite Wednesday, August 8, 2018 4:43 PM
    Tuesday, August 7, 2018 9:27 AM
  • Vivek...thanks for your response.  We cleaned out the temp locations you mentioned and that did the trick.

    Wednesday, August 8, 2018 4:45 PM