Parallel Tests

8 views
Skip to first unread message

Suresh

unread,
Jul 2, 2009, 5:36:49 PM7/2/09
to testng-users
Hi

Is it possible to have methods of one <test> run sequentially while
the methods of other <test> run parallely

For example

<suite name="MySuite" parallel="methods" thread-count="10">

<test name="test1" parallel="methods" thread-count="5">
<classes>
<class name="MyTest"/>
</classes>
</test>

<test name="test2">
<classes>
<class name="MyTest2"/>
</classes>
</test>

<test name="test3" parallel="methods" thread-count="4">
<classes>
<class name="MyTest3"/>
</classes>
</test>

</suite>

In the above case I would like methods of test1 and test3 to be run in
parallel, while the methods of test2 to be run sequentially in a
separate thread. Please let me know if there is a better way to
achieve the same objective.

Suresh

Cédric Beust ♔

unread,
Jul 2, 2009, 5:51:55 PM7/2/09
to testng...@googlegroups.com
Try to set the parallel setting at the suite level to "tests":

  <suite name="MySuite" parallel="tests" thread-count="10">

This will cause all of your <test> to run in their own thread, but since you override it to "methods" in test1 and test3, these two should run each method in their own thread.

--
Cedric
--
Cédric


Suresh Daniel

unread,
Jul 2, 2009, 8:49:15 PM7/2/09
to testng...@googlegroups.com
Thanks Cedric for the quick response. It worked.

I just need to make sure I give threadpoolsize in <test1> and <test3> to make it run in parallel. Otherwise it runs them in single thread if I have tests with invocationcount > 1

Suresh

2009/7/2 Cédric Beust ♔ <cbe...@google.com>
Reply all
Reply to author
Forward
0 new messages