testNG-6.4 parallel="classes"

502 views
Skip to first unread message

Jarrad Goodwin

unread,
Apr 4, 2012, 2:15:59 AM4/4/12
to testng-users
Hi

I am having troubles where by classses are not been run in parallel.

_______________________________________________________________________________________
<suite name="Selenium Grid Java Sample Test Suite" parallel="classes"
thread-count="7" verbose="3">
<parameter name="seleniumHost" value="xxxxxxxx" />
<parameter name="seleniumPort" value="4444" />
<parameter name="webSite" value="http://images.google.com/" />

<test name="Selenium Grid Java Sample Tests" parallel="classes">
<parameter name="browser" value="*firefox" />
<classes>
<class
name="com.thoughtworks.selenium.grid.examples.java.ParisTest" />
<class
name="com.thoughtworks.selenium.grid.examples.java.PerigordTest" />
</classes>
</test>
</siute>

__________________________________________________________________________________________
package com.thoughtworks.selenium.grid.examples.java;

import org.testng.annotations.Test;


/**
*/
public class ParisTest extends GoogleImageTestBase {

@Test(groups = {"example", "firefox", "default"}, description =
"Louvre")
public void louvre() throws Throwable {
runFlickrScenario("Louvre");
}
}

______________________________________________________________________________________
package com.thoughtworks.selenium.grid.examples.java;

import org.testng.annotations.Configuration;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;


/**
*/
public class PerigordTest extends GoogleImageTestBase {


@Test(groups = {"example", "firefox", "default"}, description =
"Lascaux Hall of the Bull")
public void rubinius() throws Throwable {
runFlickrScenario("Lascaux Hall of the Bull");
}
}

When having mutiple RC's for *firefox, it will still only run one
class at a time.....


Is there something that I am missing?


Cheers,

ssimmons

unread,
Apr 8, 2012, 2:04:24 PM4/8/12
to testng...@googlegroups.com
Try using version 6.2.1 instead and see if you get a different result. I have found that 6.4 seems to erroneously determine that your classes/methods have dependencies on each other even when they don't (at least from what I've gathered from debugging so far).

Jarrad Goodwin

unread,
Apr 11, 2012, 9:16:52 PM4/11/12
to testng-users
Thanks for the response!

Alas, with 6.2.1 I still have the same issue.

Have also tried earlier versions with still the same result :(

Has anyone managed a work arround for this?


Cheers,

On Apr 9, 4:04 am, ssimmons <stsimmo...@gmail.com> wrote:
> Try using version 6.2.1 instead and see if you get a different result. I
> have found that 6.4 seems to erroneously determine that your
> classes/methods have dependencies on each other even when they don't (at
> least from what I've gathered from debugging so far).
>
>
>
> On Wednesday, April 4, 2012 2:15:59 AM UTC-4, Jarrad Goodwin wrote:
>
> > Hi
>
> > I am having troubles where by classses are not been run in parallel.
>
> > ___________________________________________________________________________­____________
>
> > <suite name="Selenium Grid Java Sample Test Suite" parallel="classes"
> > thread-count="7" verbose="3">
> >         <parameter name="seleniumHost" value="xxxxxxxx" />
> >         <parameter name="seleniumPort" value="4444" />
> >         <parameter name="webSite" value="http://images.google.com/" />
>
> >         <test name="Selenium Grid Java Sample Tests" parallel="classes">
> >         <parameter name="browser" value="*firefox" />
> >                 <classes>
> >                         <class
> > name="com.thoughtworks.selenium.grid.examples.java.ParisTest" />
> >                         <class
> > name="com.thoughtworks.selenium.grid.examples.java.PerigordTest" />
> >                 </classes>
> >         </test>
> > </siute>
>
> > ___________________________________________________________________________­_______________
>
> > package com.thoughtworks.selenium.grid.examples.java;
>
> > import org.testng.annotations.Test;
>
> > /**
> >  */
> > public class ParisTest extends GoogleImageTestBase {
>
> >     @Test(groups = {"example", "firefox", "default"}, description =
> > "Louvre")
> >     public void louvre() throws Throwable {
> >         runFlickrScenario("Louvre");
> >     }
> > }
>
> > ___________________________________________________________________________­___________
>
> > package com.thoughtworks.selenium.grid.examples.java;
>
> > import org.testng.annotations.Configuration;
> > import org.testng.annotations.Parameters;
> > import org.testng.annotations.Test;
>
> > /**
> >  */
> > public class PerigordTest extends GoogleImageTestBase {
>
> >     @Test(groups = {"example", "firefox", "default"}, description =
> > "Lascaux Hall of the Bull")
> >     public void rubinius() throws Throwable {
> >         runFlickrScenario("Lascaux Hall of the Bull");
> >     }
> > }
>
> > When having mutiple RC's for *firefox, it will still only run one
> > class at a time.....
>
> > Is there something that I am missing?
>
> > Cheers,- Hide quoted text -
>
> - Show quoted text -

Jarrad Goodwin

unread,
Apr 12, 2012, 7:13:04 PM4/12/12
to testng-users
I have had success!! :)

And the fix is short, sweet and simple.

By adding (preserve-order="false") to the test field it will now run
classes in parallel.

I have tested with versions 6.2.1 and 6.4 and both work fine.


eg. my testng.xml now looks like this:

<suite name="Selenium Grid Java Sample Test Suite" parallel="classes"
thread-count="7" verbose="3">
<parameter name="seleniumHost" value="xxxxxxxx" />
<parameter name="seleniumPort" value="4444" />
<parameter name="webSite" value="http://images.google.com/" /
>


<test name="Selenium Grid Java Sample Tests"
parallel="classes" preserve-order="false">
<parameter name="browser" value="*firefox" />
<classes>
<class
name="com.thoughtworks.selenium.grid.examples.java.ParisTest" />
<class
name="com.thoughtworks.selenium.grid.examples.java.PerigordTest" />
</classes>
</test>
</siute>

_________________________________________________________________________________________________________________

Having preserve-order not defined, or set to true will result in
parallel classes not working.

Hope this helps others out there :D


Cheers,

On Apr 12, 11:16 am, Jarrad Goodwin <jarrad.goodwi...@gmail.com>
wrote:
> > - Show quoted text -- Hide quoted text -

ssimmons

unread,
Apr 13, 2012, 9:10:11 AM4/13/12
to testng...@googlegroups.com
I'll have to try the preserve-order trick, maybe that will help with my issue. Thanks for the update!

edwolb

unread,
Jul 9, 2012, 2:22:55 PM7/9/12
to testng...@googlegroups.com
Oh thank you.  This one had me scratching my head for a few hours.   preserve-order="false" fixed this for me, and was fairly confusing since parallel worked for tests, but not for methods or classes otherwise.

--
Chris
Reply all
Reply to author
Forward
0 new messages