gpt4 book ai didi

c# - 通过 visual studio 并行测试执行,测试被跳过

转载 作者:太空宇宙 更新时间:2023-11-03 13:13:10 28 4
gpt4 key购买 nike

我正在使用 VS2013,运行 120 个 c# selenium 测试,带有一个 .testsetting 文件,其中包含以下参数 Execution parallelTestCount="5"和 6000 毫秒(6 秒)的测试超时。测试时间超过 6 秒,我使用此配置重现了问题。6 秒后,5 个测试失败,其余测试被跳过。这是我在输出窗口中得到的:“测试运行在 Machine-Name 上中止,挂起测试的数量超过允许的最大“5”。”

测试设置文件

  <?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="RemoteWebDriver" id="e293abd4-745a-43f5-a831-2064f9305fc6" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment>
<DeploymentItem filename="TfsAutomation\testDefintionSources.config" />
<DeploymentItem filename="TfsAutomation\TfsAutomationCore.config" />
</Deployment>
<Scripts setupScript="TestScriptRemoteWebDriver.bat" />
<Execution parallelTestCount="5">
<Timeouts runTimeout="10000000" testTimeout="6000" />
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
</TestTypeSpecific>
<AgentRule name="LocalMachineDefaultRole">
</AgentRule>
</Execution>
<Properties />
</TestSettings>

最佳答案

这个问题让我想到了 this并且正在阅读一段时间。值得一提的是,MsTest 的内部结构从那时起并没有发生太大变化,至少根据上面的引用和我的知识。在不了解测试环境体系结构的内部结构的情况下,我只能得出结论说 MSTest 并行机制不适用于并行 UI 测试。其次,内核数量对 MsTest 并行执行中的并行性很重要。引用this SO answer查看有关线程管理的更多信息。所以,问题是什么是最好的解决方案。如果对 MSTest 没有太多了解,但对 Selenium 有足够的了解,我会说 Selenium-Grid。让我们网格控制并行执行以确保安全。

关于c# - 通过 visual studio 并行测试执行,测试被跳过,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27589886/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com