Testng parallel flags

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

Testng parallel flags

a12345testng
I have a project containing many classes- each containing many test methods.

I am running these tests in parallel using the parallel='methods' flag.

The classes seem to run sequentially, with each of their test methods running in parallel.

If i pass an XML with 2 classes in it:

<class>Class1</class>
<class>Class2</class>

All methods in Class1 execute in parallel, then methods in Class2 start executing once Class1 is finished.

Is it possible to interleave this execution, so that methods of Class1 and Class2 execute in parallel at the same time, each respective class running methods in parallel?

I have tried parallel='tests' and putting classes into multiple tests but from what I observed the thread count is fixed per test, but my classes have different amounts of tests, so a test may finish and those threads may sit idle which is not desired.

I have tried parallel='classes' but this is not fast enough as it provides 1 thread per class, I would like many more threads per class.

Is there a way to use parallel='classes' but with more threads per class?

Is there a different way of handling this?

I appreciate any advice or help.

Thank you.

--
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: Testng parallel flags

Steven Zaluk
To do that you need to set parallel="methods" and then thread-count="n", where n is the number of methods you want to run in parallel.  

You can read more about the flags here:  http://testng.org/doc/documentation-main.html#parallel-running

--Steve

On Fri, Oct 20, 2017 at 2:54 PM, <[hidden email]> wrote:
I have a project containing many classes- each containing many test methods.

I am running these tests in parallel using the parallel='methods' flag.

The classes seem to run sequentially, with each of their test methods running in parallel.

If i pass an XML with 2 classes in it:

<class>Class1</class>
<class>Class2</class>

All methods in Class1 execute in parallel, then methods in Class2 start executing once Class1 is finished.

Is it possible to interleave this execution, so that methods of Class1 and Class2 execute in parallel at the same time, each respective class running methods in parallel?

I have tried parallel='tests' and putting classes into multiple tests but from what I observed the thread count is fixed per test, but my classes have different amounts of tests, so a test may finish and those threads may sit idle which is not desired.

I have tried parallel='classes' but this is not fast enough as it provides 1 thread per class, I would like many more threads per class.

Is there a way to use parallel='classes' but with more threads per class?

Is there a different way of handling this?

I appreciate any advice or help.

Thank you.

--
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.
Reply | Threaded
Open this post in threaded view
|

Re: Testng parallel flags

a12345testng
I have done that.

My main question is this:

All methods in Class1 execute in parallel, then methods in Class2 start executing once Class1 is finished.

Is it possible to interleave this execution, so that methods of Class1 and Class2 execute in parallel at the same time, each respective class running their methods in parallel?
 

On Sunday, October 22, 2017 at 3:50:53 PM UTC-5, Steven Zaluk wrote:
To do that you need to set parallel="methods" and then thread-count="n", where n is the number of methods you want to run in parallel.  

You can read more about the flags here:  <a href="http://testng.org/doc/documentation-main.html#parallel-running" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Fdoc%2Fdocumentation-main.html%23parallel-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELTfrCiybnn6wM_UABFp-eGpaeNw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Fdoc%2Fdocumentation-main.html%23parallel-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELTfrCiybnn6wM_UABFp-eGpaeNw&#39;;return true;">http://testng.org/doc/documentation-main.html#parallel-running

--Steve

On Fri, Oct 20, 2017 at 2:54 PM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="D6PdqdglAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">a12345...@...> wrote:
I have a project containing many classes- each containing many test methods.

I am running these tests in parallel using the parallel='methods' flag.

The classes seem to run sequentially, with each of their test methods running in parallel.

If i pass an XML with 2 classes in it:

<class>Class1</class>
<class>Class2</class>

All methods in Class1 execute in parallel, then methods in Class2 start executing once Class1 is finished.

Is it possible to interleave this execution, so that methods of Class1 and Class2 execute in parallel at the same time, each respective class running methods in parallel?

I have tried parallel='tests' and putting classes into multiple tests but from what I observed the thread count is fixed per test, but my classes have different amounts of tests, so a test may finish and those threads may sit idle which is not desired.

I have tried parallel='classes' but this is not fast enough as it provides 1 thread per class, I would like many more threads per class.

Is there a way to use parallel='classes' but with more threads per class?

Is there a different way of handling this?

I appreciate any advice or help.

Thank you.

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="D6PdqdglAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="D6PdqdglAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@....
Visit this group at <a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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.
Reply | Threaded
Open this post in threaded view
|

Re: Testng parallel flags

Todd Bradley-2
On Mon, Oct 23, 2017 at 8:12 AM, <[hidden email]> wrote:

Is it possible to interleave this execution, so that methods of Class1 and Class2 execute in parallel at the same time, each respective class running their methods in parallel?

Not to my knowledge. Well, I should say, "It's just software; anything is possible." But I don't know of an out-of-the-box way to do this. You could get a similar effect using a TestNG factory and designing your tests in such a way that you instantiated each test class once for each method you want to run. But those may be more hoops than you want to jump through.


Todd.

--
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: Testng parallel flags

a12345testng
Thank you, I was hoping there was a simpler way to achieve this.

On Monday, October 23, 2017 at 9:48:46 AM UTC-5, Todd Bradley wrote:
On Mon, Oct 23, 2017 at 8:12 AM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="twgCfKpgAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">a12345...@...> wrote:

Is it possible to interleave this execution, so that methods of Class1 and Class2 execute in parallel at the same time, each respective class running their methods in parallel?

Not to my knowledge. Well, I should say, "It's just software; anything is possible." But I don't know of an out-of-the-box way to do this. You could get a similar effect using a TestNG factory and designing your tests in such a way that you instantiated each test class once for each method you want to run. But those may be more hoops than you want to jump through.


Todd.

--
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.