1

I'm trying to run automated GUI tests via Team Foundation Server. I developed those tests using third party software (TestComplete), but integrated them into Visual Studio 2013, and now use a batch script calling MStest.exe to execute those tests remotely on a physical server.

Using TFS works fine as long as I open and maintain a remote dektop connection to the Build PC when TFS starts the Build....Visual Studio Team Foundation Server 2015 will run the build steps like creating the VS solution, deploying a test agent on the build server, and finally executing the batch files, in the end producing th .trx file I'm after.

Without an open RDC, the step of deploying an agent will fail, saying "The job has been abandoned because agent XX did not renew the lock. Ensure agent is running, not sleeping, and has not lost communication with the service."

I'm rather new to automated testing and the architecture of TFS, so sorry if I'm somehow vague about terminology or forgot to mention relevant information...but can anyone help on this please?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
WorkFlo
  • 35
  • 5
  • I have a similar [issue](https://stackoverflow.com/questions/41858662/tfs-alm-the-session-for-this-agent-already-exists), not sure if that's relevant or not, I would check the Agents logs("C:\TFS Agent\_diag" typically) maybe there is a indication of what is wrong there. – David Rogers Sep 18 '17 at 14:26

2 Answers2

0

It seems the agent lost communications, it renews a job every 30 seconds and server will abandon the build if not heard from in 5. Please make sure without an open RDC, the build server are not sleep or hibernate. It's very likely this is the root cause.

When that occurs, look at the corresponding agent _work/_diag worker logs to collect more related info.

Also try to update your build agent version to latest and try it again. PS: you need to reconfigure the agent after the update.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
0

Thanks at all who contributed. By now, I found a workaround: I use the task scheduler to start the VSO agent upon booting, and rather than just close the RDC I reboot the Build PC. Now VS can deploy the agent and run the tests.

WorkFlo
  • 35
  • 5