【问题标题】:Visual Studio Test Run: Run Coded UI automated tests from test plans in the Test hubVisual Studio 测试运行:从测试中心的测试计划运行编码的 UI 自动化测试
【发布时间】:2018-08-02 03:43:18
【问题描述】:

构建定义

我使用与构建和发布配置相同的机器。我已经成功创建了构建。使用构建,我能够在构建中执行 Visual Studio 测试任务 中的编码 UI 脚本,并且它们工作正常我的配置是用于构建定义的,如下所述

发布目的地

在成功构建定义并执行测试脚本后,我的下一个计划是从测试中心中的测试计划运行自动化测试。我也将我的测试脚本与测试用例相关联。请查看我的发布定义的图像,其中我使用测试运行选择了测试运行

通知我在测试中心的测试计划执行自动化测试失败后收到

Deployment of release Release-11 Rejected in Deploy Test Scripts.

日志

2018-02-21T14:24:20.8978238Z AgentName: EVSRV017-DEVSRV017-4
2018-02-21T14:24:20.8978238Z AgentId: 29
2018-02-21T14:24:20.9038250Z ServiceUrl: https://mytfsserver/tfs/DefaultCollection/
2018-02-21T14:24:20.9038250Z TestPlatformVersion: 
2018-02-21T14:24:20.9038250Z EnvironmentUri: dta://env/Calculator/_apis/release/16/20/1
2018-02-21T14:24:20.9038250Z QueryForTaskIntervalInMilliseconds: 3000
2018-02-21T14:24:20.9038250Z MaxQueryForTaskIntervalInMilliseconds: 10000
2018-02-21T14:24:20.9048252Z QueueNotFoundDelayTimeInMilliseconds: 3000
2018-02-21T14:24:20.9058254Z MaxQueueNotFoundDelayTimeInMilliseconds: 50000
2018-02-21T14:24:20.9058254Z RetryCountWhileConnectingToTfs: 3
2018-02-21T14:24:20.9058254Z ===========================================
2018-02-21T14:24:21.3909224Z Initializing the Test Execution Engine

警告

2018-02-21T14:25:02.1240674Z ##[warning]Failure attempting to call the restapis. Exception: System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
2018-02-21T14:25:02.1240674Z    at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
2018-02-21T14:25:02.1240674Z    at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
2018-02-21T14:25:02.1240674Z    --- End of inner exception stack trace ---

错误:

2018-02-22T10:10:42.0007605Z ##[error]System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

我添加了调试变量,似乎在创建设置文件时,它类似于system.io异常。

启用调试日志

2018-02-22T20:17:53.8151287Z Initializing the Test Execution Engine
2018-02-22T20:17:53.8161287Z ##[debug]Creating test settings. test settings name : 44de4d5b-f134-4ba2-b0de-ebd8d30b4d22
2018-02-22T20:18:35.3911287Z ##[warning]Failure attempting to call the restapis. Exception: System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
2018-02-22T20:18:35.3931287Z ##[debug]Processed: ##vso[task.logissue type=warning;]Failure attempting to call the restapis. Exception: System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

TFS 代理日志

[INFO VstsAgentWebProxy] No proxy setting found.    
[INFO ConfigurationStore] IsServiceConfigured: False
[INFO ConfigurationManager] Is service configured: False

工人日志

[2018-02-23 19:32:17Z INFO VstsAgentWebProxy] No proxy setting found.
[2018-02-23 19:32:52Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2018-02-23 19:32:52Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2018-02-23 19:32:53Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2018-02-23 19:33:34Z INFO JobServerQueue] Catch exception during update timeline records, try to update these timeline records next time.
[2018-02-23 19:33:34Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:49.0055812.
[2018-02-23 19:33:34Z INFO StepsRunner] Step result: Failed
[2018-02-23 19:33:34Z INFO StepsRunner] Update job result with current step result 'Failed'.
[2018-02-23 19:33:34Z INFO StepsRunner] Current state: job state = 'Failed'
[2018-02-23 19:33:34Z INFO JobRunner] Job result after all job steps finish: Failed
[2018-02-23 19:33:34Z INFO JobRunner] Run all post-job steps.
[2018-02-23 19:33:34Z INFO JobRunner] Job result after all post-job steps finish: Failed
[2018-02-23 19:33:34Z INFO JobRunner] Completing the job execution context.
[2018-02-23 19:33:34Z INFO JobServerQueue] Try to append 2 batches web console lines, success rate: 2/2.
[2018-02-23 19:33:34Z INFO JobRunner] Shutting down the job server queue.
[2018-02-23 19:33:34Z ERR  JobServerQueue] Microsoft.VisualStudio.Services.Common.VssServiceException: String or binary data would be truncated.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__48.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__27`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__26`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.JobServerQueue.<ProcessTimelinesUpdateQueueAsync>d__32.MoveNext()
[2018-02-23 19:33:34Z INFO JobServerQueue] Fire signal to shutdown all queues.
[2018-02-23 19:33:35Z INFO JobServerQueue] All queue process task stopped.
[2018-02-23 19:33:35Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2018-02-23 19:33:35Z INFO JobServerQueue] Web console line queue drained.
[2018-02-23 19:33:35Z INFO JobServerQueue] Try to upload 2 log files or attachments, success rate: 2/2.
[2018-02-23 19:33:35Z INFO JobServerQueue] File upload queue drained.
[2018-02-23 19:33:35Z INFO JobServerQueue] Timeline update queue drained.
[2018-02-23 19:33:35Z INFO JobServerQueue] All queue process tasks have been stopped, and all queues are drained.
[2018-02-23 19:33:35Z INFO JobRunner] Raising job completed event.
[2018-02-23 19:33:35Z INFO Worker] Job completed.

如果有人能确定我在哪里遗漏了什么或者我需要解决这个问题以便我可以在测试中心的测试计划中执行自动化测试,我将不胜感激。

问候

【问题讨论】:

  • 您使用的是什么操作系统? win server 2008 R2 或 2012 R2 或其他?您是否为 TFS 设置了代理?你启动杀毒软件了吗?似乎是连接问题。
  • 赢服务器 2008 R2。是的,已经设置了 TFS 代理。它是没有杀毒软件的虚拟机
  • 在我看来,当它要创建测试设置文件时,它会出现 IOException 异常,并且由于这个问题,TFS 正在强制关闭连接。而我没有添加任何测试设置文件。这个问题有什么解决方法吗?
  • 根据您的问题,我已经查看了工作人员和代理日志,我的发现会在帖子中更新

标签: tfs continuous-integration tfsbuild coded-ui-tests continuous-deployment


【解决方案1】:

基于错误消息“Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.”和您的说明。它应该与win server 2008 R2 上的已知问题有关。详情请参考以下文章:

Team Foundation Server: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

但是,Windows 团队已经修复了这个错误,并且他们已经 为它发布了一个 QFE。您可以找到 QFE here。你会 需要在你所有的 AT 上安装它。

因此,只需尝试安装此修补程序并在应用此修补程序后重新启动计算机,然后再试一次。

您也可以尝试使用博客中列出的初始解决方法:

  1. 打开 IIS 管理器
  2. 在“连接”窗格中,确保选择了您的 AT 名称。
  3. 在中间窗格(标题为“主页”)中,确保您是 在“功能视图”(底部)并向下滚动到管理 部分。
  4. 双击“配置编辑器”图标。
  5. 中间窗格现在应该有标题“配置编辑器”。 在靠近顶部的下拉部分中,展开 system.applicationHost 并选择“webLimits”。
  6. 您现在应该看到一堆属性值对,其中一个是 命名为“minBytesPerSecond”。它的值最像 240。你会 想要降低此值以解决问题。

另外,还有一种可能是代理服务器造成的,尝试绕过代理服务器,再检查一遍。

【讨论】:

  • 感谢您的回复,我尝试安装QFE。它说“更新不是应用到您的计算机”。我已经安装了 IIS。我的应用程序是基于桌面的应用程序,当我单击 TFS 测试中心中的运行按钮时将执行该应用程序。在 IIs manager 中,minBytesPerSecond 已经设置为 240。 至于绕过代理服务器,我不在 TFS Server 上。我已经在本地机器上下载并安装了代理。如何从本地计算机绕过代理服务器?
  • 我的本地机器名是 abc,我的 tfs 服务器是 server/tfs。代理安装在我的本地机器上,我检查了微软文档以运行私有代理绕过代理它说,./config.cmd --proxyurl 127.0.0.1:8888 .... 但它没有解释我本地机器的代理url,即localhost:8888 或我的 tfs 网址 myserver/tfs
  • 另外,我的 TFS 位于不同的域,即 TFS\myusername 并且我的机器位于不同的域 mymachine\mymachine。
  • 当我尝试执行时代理用户名 -- 代理密码
  • 因此,在多次尝试之后,我发现我的构建服务器在域 DEV 上,而我的 TFS 服务器在域 TFS_DOMAIN 上。代理正在保存 DEV 域的凭据。但是,我尝试将其配置为 SE:\agent> ./config.cmd --unattended --url myTFS Server/tfs --auth Integrated --pool DemoAgent --a gent DEV_MACHINE_NAME --windowslogonaccount TFS_DOMAIN\ aqdas--windowslogonpassword密码101
猜你喜欢
  • 2021-03-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多