Total thread count in testng parallel tests with dataproviders

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Total thread count in testng parallel tests with dataproviders

Дмитрий Санковский

How can I control total number of test threads in testng when using parallel dataproviders(and data-provider-thread-count parameter) along with thread-count parameter?

  • - I have a suite of integration api tests.
  • - I run my integration suite in parallel with tread-count=10
  • - I wish my dataproviders also could be ran in parallel, if there is idle threads in pool
  • - I wish total thread count be predictable and constant of 10 for tests stability reasons
  • - How can I do this?

The problem is, that there may be the case in my suite, when long test with dataprovider starts last in the suite, and it take a long time to finish, as it goes in 1 thread. Now, if I use data-provider-thread-count parameter, it will parallel dataproviders, but in a separate thread-pool. So let's say I have thread-count parameter of 10 and data-provider-thread-count parameter of 5. With this setup a case may appear, when 10 tests with dataproviders are launched, and each dataprovider runs in 5 thread, and it results in total of 10 * 5 = 50 threads. As I mentioned, total of 50 threads is not suitable for me due to test stability reasons.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Total thread count in testng parallel tests with dataproviders

⇜Krishnan Mahadevan⇝

TestNG uses one thread pool controlled by thread-count for ordinary test methods and uses another thread pool controlled by data-provider-thread-count for @DataProvider driven test methods.

 

So you would never be in a situation wherein your data provider driven tests are starving out your regular test methods and can very well run your regular test methods and a dataprovider powered test method both in parallel without any issues.

 

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/

 

From: <[hidden email]> on behalf of Дмитрий Санковский <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, August 2, 2018 at 7:38 PM
To: testng-users <[hidden email]>
Subject: [testng-users] Total thread count in testng parallel tests with dataproviders

 

How can I control total number of test threads in testng when using parallel dataproviders(and data-provider-thread-count parameter) along with thread-count parameter?

  • - I have a suite of integration api tests.
  • - I run my integration suite in parallel with tread-count=10
  • - I wish my dataproviders also could be ran in parallel, if there is idle threads in pool
  • - I wish total thread count be predictable and constant of 10 for tests stability reasons
  • - How can I do this?

The problem is, that there may be the case in my suite, when long test with dataprovider starts last in the suite, and it take a long time to finish, as it goes in 1 thread. Now, if I use data-provider-thread-count parameter, it will parallel dataproviders, but in a separate thread-pool. So let's say I have thread-count parameter of 10 and data-provider-thread-count parameter of 5. With this setup a case may appear, when 10 tests with dataproviders are launched, and each dataprovider runs in 5 thread, and it results in total of 10 * 5 = 50 threads. As I mentioned, total of 50 threads is not suitable for me due to test stability reasons.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.