multithreading - 在不同线程中运行多个同步和异步测试套件
问题描述
在我的 testng 中,我有多个测试套件。例如
<suite name="Suite">
<suite-files>
<suite-file path="ASynchronousTestfile1.xml"/>
<suite-file path="SynchronousTestfile2.xml"/>
<suite-file path="SynchronousTestfile3.xml"/>
</suite-files>
</suite>
现在,在单独的 testng 线程上运行套件。我正在使用surefire插件配置在单独的线程上运行它。像这样的东西:
<configuration>
<suiteXmlFiles>testng.xml</suiteXmlFiles>
<skipTests>false</skipTests>
<properties>
<property>
<name>suitethreadpoolsize</name>
<value>3</value>
</property>
</properties>
</configuration>
现在因为我的 ASynchronousTestFile1.xml 有非依赖的测试用例,我希望这个测试套件在多个线程上运行。因此,我通过以下方式在套件本身上提供了测试级并行性:
<test name="All Asynchronous Tests" parallel="methods" thread-count="7">
所以我的看法是总共有 9 个线程,其中 2 个将定义为 2 个同步套件,7 个线程用于异步测试套件。
我在哪里失踪或实现这种情况的正确方法是什么?
解决方案
推荐阅读
- javascript - 如何拆分数组中的数字?javascript
- mysql - 如何在mysql数据库中以整数形式进行ipv6?
- javascript - 在所有键值对都是唯一的对象数组中查找对象
- python - 没有从 main 返回的值
- javascript - 如何在特定的 binlog 位置重启?
- deployment - Azure DevOps 发布管道上的 ClickOnce 部署
- html - 为什么我的嵌套网格没有显示在屏幕上?CSS
- angular - AsyncValidatorFn 和 AsyncValidator 接口 - 使用一个比另一个有哪些好处?
- javascript - 调用 Date() 构造函数时是否可以显式省略参数?
- android - Android Gradle Plugin 3.6.2 - 不从本地 AAR 中选择 .so 库