TestNG.xml - suite parallel vs test parallel

Viewed 15

I've just found following TestNG configuration in my work project:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Parallel_Suite" configfailurepolicy="continue" thread-count="4" parallel="tests">
    <test verbose="2" name="all_tests" thread-count="3" parallel="classes">
        <classes>
            ...
        </classes>
    </test>
    <test verbose="2" name="BetPlacement_tests" thread-count="1" parallel="classes">
        <classes>
            ...
        </classes>
    </test>
</suite>

Have a two questions:

  1. parallel and thread-count parametes on suite and test levels - are they working together ?

I mean, if I understand correctly - "thread-count="4" parallel="tests"" on 'suite' level means that all the methods in the same 'test' tag must be executed in the same thread, but each 'test' tag must be executed in a separate thread

And for example "thread-count="3" parallel="classes"" on 'test' level means that classes inside this 'test' tag should be executed in parallel

So as a result, I suppose it work like this - parallel execution for 'test' tags in suite, and parallel classes execution in each 'test' tag ?

Or parallel on 'test' level won't work if parallel on 'suite' level is defined ?

  1. thread-count="1" parallel="classes" - this is useless, right ? Looks like it's the same like without parallel at all
0 Answers
Related