testNG tests in parallel within Eclipse vs TeamCity

Hi,

I have a .xml file set up in the following manner, which if I right click in Eclipse and say "run as testNG suite", it works properly, including running the subset of tests in parallel that I think it should:

<suite name = "Installs" preserve-order="true" parallel="methods" thread-count="5">

   <test name="class1">
         <classes>
             <class name="com.xx.qe.xx.installs.class1">
                 <methods>
                     <exclude name=".*_excluded"/>
                 </methods>
             </class>
         </classes>
     </test>


   <test name="class2">
         <classes>
             <class name="com.xx.qe.xx.installs.class2">
                 <methods>
                     <exclude name=".*_excluded"/>
                 </methods>
             </class>
         </classes>
     </test>


       <test name="class3">
         <classes>
              <class name="com.xx.qe.xx.installs.class3">
             </class>
         </classes>
     </test>


</suite>

But -- when using TeamCity (latest version, 6.5.2, same behavior also in 6.0.2) that has the testNG plug in by default -- some of the tests don't run in parallel, (but they do from within Eclipse). Specifically, when run from BOTH eclipse and TeamCity, the methods run in parallel from the class1.

But when run within TeamCity, the methods in class2 do NOT run in parallel (but they do when run from Eclipse). In case it's relevant, I should mention that there is one test method in class2 that is dependent on a list of 4 other test methods in that same class. That depedency is honored in both the Eclipse and TeamCity runs, but the 4 test methods in that class only run in parallel when run within Eclipse. In TeamCity, those 4 run, but in sequence.

Any ideas? I'm guessing there is some kind of xml file that is 'built' with the teamcity testNG plugin that I could look for that might yield some clues, but I don't know where that is. :)

Any suggestions would be greatly appreciated. Thanks!

1 comment
Comment actions Permalink

Found and fixed the problem, and had nothing to do with TeamCity (as you probably guessed) :).

Maven's surefire-plugin (which I think pulls in testNG) was set to be dependent on version 2.6.

2.9 is the latest, and it looks like that pulls in a newer version of testNG, which is probably closer to what I was using for testNG natively within Eclipse.

I'm seeing the same behavior now re: running tests in parallel between running them in Eclipse, vs running them in TeamCity.

0

Please sign in to leave a comment.