【问题标题】:testng tasks running parallely on different JVMstestng 任务在不同的 JVM 上并行运行
【发布时间】:2016-06-09 09:46:02
【问题描述】:

我需要在两个不同的 JVM 实例中并行启动 testng 类。我正在尝试使用 ant 并行任务来实现这一点,但没有成功。使用下面的块,它按顺序而不是并行启动两个 testng 任务。你能帮我解决这个问题吗?

<parallel threadCount="1">
   <testng classpathref="maven.test.classpath" outputdir="target/first">
      <classfileset dir="build">
         <include name="**/TestX.class" />
      </classfileset>
      <jvmarg line="${java.args}" />
      <jvmarg line="${run.args}" />
   </testng>
   <testng classpathref="maven.test.classpath" outputdir="target/second">
      <classfileset dir="build">
         <include name="**/TestY.class" />
      </classfileset>
      <jvmarg line="${java.args}" />
      <jvmarg line="${run.args}" />
   </testng>
</parallel>

【问题讨论】:

  • 你想通过增加threadCount属性值来试试看吗?
  • 不,那也没用 :(
  • 也许你可以检查样品here
  • 已经检查过了,实际上链接中的那些特定示例也可以工作。我发现的问题是 testng 任务的并行模式(注意:testng 任务在不同的虚拟机中运行)

标签: java xml maven ant testng


【解决方案1】:

根据 TestNG 任务文档,它始终以 fork 模式运行(从 Ant 中单独的 JVM 中读取)。所以,我认为threadCount="1" 可能是顺序执行的原因。

【讨论】:

  • 感谢回复,可惜没有影响!
猜你喜欢
  • 1970-01-01
  • 2022-01-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-08-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多