0
votes

I working on a new non-XAML TFS build. My objective is to build the test project on our build agent VM, copy the test binaries to our test agent VM and execute our Selenium web UI tests from the test agent VM.

My build definition process looks like this:

  • Get Sources
  • NuGet Installer
  • MSBuild (builds test project)
  • Windows Machine Copy (copies test project bin folder contents to test agent VM)
  • Visual Studio Test Agent Deployment (deploy test agent to test agent VM)
  • Run Functional Tests

At this point, when I kick off a build, all steps as far as and including Visual Studio Test Agent Deployment are completing successfully.

However, when the Run Functional tests task begins execution, we are seeing the following console output:

Preparing task execution handler.

Executing the powershell script: D:\tfsbuild-2_work_tasks\RunVisualStudioTestsusingTestAgent_d353d6a2-e361-4a8f-8d8c-123bebb71028\1.0.52\RunDistributedTests.ps1

DistributedTests: Environment WinRm Protocol HTTP.

DistributedTests: Creating run for selected test assemblies with following parameters

DistributedTests: SourceFilter: ***Test*.dll TestCaseFilter:

DistributedTests: Run title: [Run Title]

DistributedTests: is automated: True

DistributedTests: test settings id : [test settings id]

DistributedTests: build location: [TestProjectLocation]

DistributedTests: build id: [build id]

DistributedTests: test configuration mapping:

DistributedTests: Test Run with Id [run#] Queued

DistributedTests: Test run '[run#]' is in 'InProgress' state

The Run Functional Tests task continues to attempt execution until time-out, showing DistributedTests: Test run '[run#]' is in 'InProgress' state in the TFS console output.

The DTAExecutionHost.exe log file shows the following entries for each corresponding console output:

DTAExecutionHost.exe Information: 0 : TestExecutionServiceCommandQueueListener.DispatchAsync : Getting Command for Test Agent 19 DateTime=2018-07-19T14:36:27.6387445Z

Web method running: [https://.../test/Agents/19/Commands/0] (GET)0[test]

Web method response: [https://.../test/Agents/19/Commands/0] (GET)0[test] 153 ms

DTAExecutionHost.exe Information: 0 : TestExecutionServiceCommandQueueListener:DispatchAsync Command Microsoft.TeamFoundation.Test.WebApi.TestExecutionServiceCommand received. DateTime=2018-07-19T14:36:27.7794911Z

DTAExecutionHost.exe Information: 0 : TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand received with None. Retrying it. DateTime=2018-07-19T14:36:27.7794911Z

DTAExecutionHost.exe Information: 0 : TestExecutionServiceCommandQueueListener.DispatchAsync : Queue not found. Delaying for 50000 milliseconds. DateTime=2018-07-19T14:36:27.7794911Z

In my Visual Studio Test Agent Deployment task, selected protocol is HTTP, the Run UI tests checkbox is ticked, Update test agent checkbox is unticked.

During Visual Studio Test Agent Deployment task, blank DTAExecutionHost.exe console window opens on the test agent VM; this window remains open for the duration of the test run attempt.

All tests in the project are discovered and execute as expected in Visual Studio on local machine.

I have read a number of blogs, posts, discussion threads on this issue in recent days but have so far been unable to find a resolution to the problem. Please assist; any and all insights and suggestions welcome.

UPDATE: 21 August 2018

This issue persists. Answer provided below appeared to fix problem but issue returned, intermittently at first (I have had successful executions), now timing out on test execution step for every build.

I've unmarked the answer below as correct.

1

1 Answers

0
votes

I managed to get this working by making some changes to my setup:

  1. Created new solution for my web UI test project (this project had been part of overall larger solution; I had been copying just the test project from the original solution build to the test agent VM).
  2. Added .testsettings file to solution (all settings in this file left as default, except Enable deployment checkbox ticked on Deployment tab). In my test project, under Test -> Test Settings -> select Test Setting File, I added the newly created .testsettings file.

Once all updates had been checked into TFS, a new build completed successfully. All tests in the assembly were discovered and executed as expected.

See m00nbeam360.0's contribution here:

Running Selenium functional test in TFS 2015 vNext repeats 'InProgress' and eventually times out