Having a set of test suites that runs in parallel inside of another suite also configured to be run in parallel

575 views
Skip to first unread message

Alberto Lopez

unread,
Oct 6, 2015, 4:13:07 PM10/6/15
to testng-users
Hi everyone,

Could any of you tell me what would be the effect of having a test suite configured to be run in parallel (using "methods" value), containing a set of different suites that could run by separate that also has the same parallel attribute?

Basically, want to understand how it would run my Selenium test suite on the grid with the next configuration:

<suite name="FullSuite" parallel="methods" thread-count="5">
    <parameter name="browser" value="ie"/>
    <parameter name="environment" value="qa"/>
    <parameter name="runLocation" value="remote"/>
  <suite-files>
   <suite-file path="Suite_Adding.xml" />
   <suite-file path="Suite_Retrieving.xml" />
            <suite-file path="Suite_Retrieving.xml" />
   <suite-file path="Suite_Deleting.xml" />
        </suite-files>
</suite>

And every of the suites also has next atttributes: parallel="methods" thread-count="5

Would I have only 5 threads? Or there would be a sum of all threads? Do you see any gap / potential issue? Just want to ensure I'm doing the right stuff in the most optimal way.

Many thanks in advance,

Alberto.

Krishnan Mahadevan

unread,
Oct 7, 2015, 12:04:38 AM10/7/15
to testng...@googlegroups.com
Alberto,
Here's what I know :
  • Your FullSuite is essentially a "suite of suites". It wont execute any of the suites in parallel, at-least NOT using the surefire-plugin. You can currently run suites in parallel only when you run your suite xml file using java -cp testng.jar org.testng.TestNG mechanism.
  • TestNG basically has 2 flavours of parallel executions.
    • Parallel <test> executions.
      • In a TestNG Suite XML, if you have parallel="tests" at the <suite> tag level, TestNG basically allocates a thread-pool whose size is equal to the thread-count tag of the <suite> tag. So for e.g., if you have parallel="tests" and thread-count="3" and you have 4 <test> tags in your suite file, then TestNG creates 3 threadpools and distributes the first 3 <test> tests to each of these 3 thread-pools.The 4th one would basically wait till one of the <test> tags run to completion. 
      • Now within the <test> tag, the parallel attribute basically governs how the test methods are to be executed. 
    • Parallel <instance|class|method> executions. (defined at the <suite> level)
      • In this case, the thread-count attribute defined at the <suite> level determines how many threads should be allocated to one thread-pool.
      • The interesting part here is that, in this parallel execution flavour, there is just 1 thread-pool that is created by TestNG.
Hope this helps you get some understanding. I may be wrong, but I have best tried to summarise what I have witnessed as behaviour by writing some samples.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages