在 TFS 2015 vNext 中运行 Selenium 功能测试会重复“InProgress"并最终超时 [英] Running Selenium functional test in TFS 2015 vNext repeats 'InProgress' and eventually times out

查看:31
本文介绍了在 TFS 2015 vNext 中运行 Selenium 功能测试会重复“InProgress"并最终超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 TFS 2015 上 vNext 构建定义中的运行功能测试步骤运行 Selenium 测试,测试项目的源构建在 TFS 服务器上并复制到运行 Windows 8.1 的远程计算机.但是,当要运行单元测试时,在 TFS 控制台中重复消息测试处于状态 'InProgress'"时没有任何反应.在远程机器的 DTAExecutionHost 日志文件中,重复了以下几行(日志文件末尾的片段).

I'm trying to run a Selenium test using the Run Functional Test step from a vNext build definition on TFS 2015, the test project's sources are built on the TFS server and copied to a remote machine running Windows 8.1. However, when it's to run the unit test, nothing happens with a repeated message " test is in state 'InProgress' " in the TFS console. On the DTAExecutionHost log file in the remote machine, the following lines are repeated (snippet from end of log file).

Web 方法运行:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test]Web 方法响应:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 15 msV, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsyncW, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand 收到无.重试.W, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync :未找到队列.延迟 50000 毫秒.V, 3872, 18, 2016/09/22, 13:45:55.773, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : 获取测试代理的命令 Microsoft.TeamFoundation.Test.WebApi.TestAgentWeb 方法运行:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test]Web 方法响应:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 15 msV, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsyncW, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand 收到无.重试.W, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync :未找到队列.延迟 50000 毫秒.V, 3872, 17, 2016/09/22, 13:46:45.792, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : 获取测试代理的命令 Microsoft.TeamFoundation.Test.WebApi.TestAgentWeb 方法运行:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test]Web 方法响应:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 16 msV, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsyncW, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand 收到无.重试.W, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync :未找到队列.延迟 50000 毫秒.I, 4076, 1, 2016/09/22, 14:48:08.685, 158348745970, DTAExecutionHost.exe, Main.TryReadAndCacheVssCredentials 获取令牌信息I, 4076, 1, 2016/09/22, 14:48:08.841, 158350330678, DTAExecutionHost.exe, 与令牌服务通信https://.com/tfs/DefaultCollectionW, 4076, 1, 2016/09/22, 14:48:10.060, 158362406863, DTAExecutionHost.exe, 服务任务失败.重试尝试 10.W, 4076, 1, 2016/09/22, 14:48:13.106, 158392951673, DTAExecutionHost.exe, 服务任务失败.重试 9.W, 4076, 1, 2016/09/22, 14:48:16.121, 158423022807, DTAExecutionHost.exe, 服务任务失败.重试尝试 8.

Web method running: [https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] Web method response: [https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 15 ms V, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync W, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand received with None. Retrying it. W, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Queue not found. Delaying for 50000 milliseconds. V, 3872, 18, 2016/09/22, 13:45:55.773, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Getting Command for Test Agent Microsoft.TeamFoundation.Test.WebApi.TestAgent Web method running: [https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] Web method response: [https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 15 ms V, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync W, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand received with None. Retrying it. W, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Queue not found. Delaying for 50000 milliseconds. V, 3872, 17, 2016/09/22, 13:46:45.792, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Getting Command for Test Agent Microsoft.TeamFoundation.Test.WebApi.TestAgent Web method running: [https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] Web method response: [https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 16 ms V, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync W, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand received with None. Retrying it. W, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : Queue not found. Delaying for 50000 milliseconds. I, 4076, 1, 2016/09/22, 14:48:08.685, 158348745970, DTAExecutionHost.exe, Main.TryReadAndCacheVssCredentials Acquiring the Token Info I, 4076, 1, 2016/09/22, 14:48:08.841, 158350330678, DTAExecutionHost.exe, Communicating to the Token Servicehttps://.com/tfs/DefaultCollection W, 4076, 1, 2016/09/22, 14:48:10.060, 158362406863, DTAExecutionHost.exe, Service task failed. Retry attempt 10. W, 4076, 1, 2016/09/22, 14:48:13.106, 158392951673, DTAExecutionHost.exe, Service task failed. Retry attempt 9. W, 4076, 1, 2016/09/22, 14:48:16.121, 158423022807, DTAExecutionHost.exe, Service task failed. Retry attempt 8.

我在测试代理部署步骤中启用了交互选项,如下所示:测试代理部署配置步骤

I have the Interactive option enabled in the Test Agent Deployment step as seen here: Test Agent Deployment Configuration Step

欢迎任何反馈!

推荐答案

我在 Run Functional Tests 任务中运行 Selenium 测试时遇到了很多困难,但最终通过大量反复试验使其工作.

I struggled a lot with running Selenium tests in the Run Functional Tests task, but eventually got it working with a lot of trial-and-error.

首先,如果我是你,我会尝试在你想要测试的机器上安装一个交互式代理,并确保它在该机器上本地运行 VS 测试任务.如果是,那么您可以缩小问题的范围.

First, if I were you, I would try installing an interactive agent onto that machine you're wanting to test with and make sure that it runs locally on that machine with the VS Test task. If it does, then you can narrow the scope of the issue down.

我使用的 Selenium 测试还需要指向要运行的 DLL(我相信在我们的案例中它们是 NUnit).因此,根据 task,我创建了仅指定 testadapterspath 标记 的运行设置文件(确保包含如果在 RM 中,则将 dll 放入 drop 中).当指向 runsettings 文件时,一定要指向构建/发布代理上的位置,而不是测试代理位置(这让我有点受骗).

The Selenium tests that I used needed to also point to the DLLs for it to run (I believe they were NUnit in our case). So per the task, I created a run settings file that only specified the testadapterspath tag (make sure to include the dlls into the drop if in RM). When pointing to the runsettings file, be sure to point to the location on the build/release agent, not the test agent location (that tricked me for a bit).

然后,如果您遇到 DTAExecutionHost 崩溃的问题(尝试像我一样双击安装在 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE 的 exe),我想您仍然需要通过此 GitHub 帖子 联系 Microsoft,以便他们向您发送补丁exe.

Then, if you are running into issues with DTAExecutionHost crashing (try to double-click on the exe that's installed at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE) like I had, I think you still need to contact Microsoft from this GitHub post for them to send you a patched exe.

更新:我还注意到错误指向https://.com/..." 并且可能没有正确找到您的 TFS 实例.我会尝试通过代理池和 VS 测试任务在本地运行测试,然后查看是否仍然出现相同的错误.

Update: I also notice that the error is pointing to "https://.com/..." and maybe it's not finding your TFS instance properly. I would try running the tests locally via an agent pool and the VS Test task then to see if that still gives the same error.

这可能无法直接解决您的问题,但可能会让您找到正确的方向.希望能帮到你!

This may not solve your issue directly but may get you in the right direction. Hope it helps!

这篇关于在 TFS 2015 vNext 中运行 Selenium 功能测试会重复“InProgress"并最终超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆