TestNg - Sharing thread-count from thread-count and data-provider-thread-count

31 views Asked by At

My test suite has a mix of tests using data providers and regular tests running in parallel. I want to be able to restrict the TOTAL number of threads spawned. However, since I am setting the thread amount of each separately I can't see a way of restricting the total number.
For example, if I want a maximum of 10 tests and set thread-count=5 and data-provider-thread-count = 5. Then if either type of test finishes first I will still have 5 threads sitting idle and ideally, I'd want these threads to be used to finish the other type of test.

I looked into trying to change the thread-count of either dynamically but I don't think it is possible to change the thread-count at run time. That being said is there any way of achieving what I want?

Summary: I am able to run both data provider tests and regular tests parallel but I am not able to control/share their threads.

0

There are 0 answers