Thread-count is set to 3 in testng.xml, but all threads are starting at once.

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

Thread-count is set to 3 in testng.xml, but all threads are starting at once.

garvitagirotraev
Hi,

My thread-count is set to 3 but more all threads are starting at once.

Earlier design: One @Test per class that are running in parallel. 3 threads start in parallel and one ends only then new thread starts.

Current design: Multiple @Test per class that are running in parallel. Execution starts with 3 threads but soon after that one by one all threads open .

Here is testng.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" configfailurepolicy="continue">
    <listeners>
        <listener class-name="ipd.listeners.implementation.TestListener"></listener>
    </listeners>

    <test name="Charting" parallel="classes" thread-count="3">
        <classes>
            <class name="class 1" />
            <class name="class 2" />
            <class name="class 3" />
            <class name="class 4" />
            <class name="class 5" />
            <class name="class 6 />
            <class name="class 7" />
        </classes>
    </test>
</suite>

Here is test class :

public class BarChart extends Charts {
   
    /* load property file and navigate to analytics page. */
    @BeforeClass
    public void load() throws IOException {
        loadChart("barchart");
    }

    @Test(priority = 0)
    public void parameter1()
            throws InterruptedException {
        makechart();
    }

    @Test(priority = 1)
    public void parameter2()
            throws InterruptedException {
       makechart();
    }

    @Test(priority = 2)
    public void parameter3()
            throws InterruptedException {
        makechart();
    }
}

Thanks !!

--
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: Thread-count is set to 3 in testng.xml, but all threads are starting at once.

akash kansal
try after changing parallel to methods.

<test name="Charting" parallel="methods" thread-count="3">
 f

On Tue, Jul 24, 2018 at 3:36 PM, <[hidden email]> wrote:
Hi,

My thread-count is set to 3 but more all threads are starting at once.

Earlier design: One @Test per class that are running in parallel. 3 threads start in parallel and one ends only then new thread starts.

Current design: Multiple @Test per class that are running in parallel. Execution starts with 3 threads but soon after that one by one all threads open .

Here is testng.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" configfailurepolicy="continue">
    <listeners>
        <listener class-name="ipd.listeners.implementation.TestListener"></listener>
    </listeners>

    <test name="Charting" parallel="classes" thread-count="3">
        <classes>
            <class name="class 1" />
            <class name="class 2" />
            <class name="class 3" />
            <class name="class 4" />
            <class name="class 5" />
            <class name="class 6 />
            <class name="class 7" />
        </classes>
    </test>
</suite>

Here is test class :

public class BarChart extends Charts {
   
    /* load property file and navigate to analytics page. */
    @BeforeClass
    public void load() throws IOException {
        loadChart("barchart");
    }

    @Test(priority = 0)
    public void parameter1()
            throws InterruptedException {
        makechart();
    }

    @Test(priority = 1)
    public void parameter2()
            throws InterruptedException {
       makechart();
    }

    @Test(priority = 2)
    public void parameter3()
            throws InterruptedException {
        makechart();
    }
}

Thanks !!

--
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: Thread-count is set to 3 in testng.xml, but all threads are starting at once.

garvitagirotraev
Hi Akash,

I tried with it, still facing same thing. To be very accurate : as soon as first @Test pass or complete, another thread starts . Test are running fine in their individual threads. 

On Tuesday, July 24, 2018 at 4:15:56 PM UTC+5:30, akash kansal wrote:
try after changing parallel to methods.

<test name="Charting" parallel="methods" thread-count="3">
 f

On Tue, Jul 24, 2018 at 3:36 PM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="FmXgcHHUBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">garvitag...@...> wrote:
Hi,

My thread-count is set to 3 but more all threads are starting at once.

Earlier design: One @Test per class that are running in parallel. 3 threads start in parallel and one ends only then new thread starts.

Current design: Multiple @Test per class that are running in parallel. Execution starts with 3 threads but soon after that one by one all threads open .

Here is testng.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;">http://testng.org/testng-1.0.dtd">
<suite name="Suite" configfailurepolicy="continue">
    <listeners>
        <listener class-name="ipd.listeners.implementation.TestListener"></listener>
    </listeners>

    <test name="Charting" parallel="classes" thread-count="3">
        <classes>
            <class name="class 1" />
            <class name="class 2" />
            <class name="class 3" />
            <class name="class 4" />
            <class name="class 5" />
            <class name="class 6 />
            <class name="class 7" />
        </classes>
    </test>
</suite>

Here is test class :

public class BarChart extends Charts {
   
    /* load property file and navigate to analytics page. */
    @BeforeClass
    public void load() throws IOException {
        loadChart("barchart");
    }

    @Test(priority = 0)
    public void parameter1()
            throws InterruptedException {
        makechart();
    }

    @Test(priority = 1)
    public void parameter2()
            throws InterruptedException {
       makechart();
    }

    @Test(priority = 2)
    public void parameter3()
            throws InterruptedException {
        makechart();
    }
}

Thanks !!

--
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="FmXgcHHUBgAJ" 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="FmXgcHHUBgAJ" 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: Thread-count is set to 3 in testng.xml, but all threads are starting at once.

garvitagirotraev

I have attached snapshot of my console output. Here are 5 class : BarChart, LineChart , BubbleChart, PieChart and StackedBar chart under package ipd.project.analytics.
I ran with each class having 3 @Test method.

In console output, as soon as 1st @Test pass, new thread starts. I printed "driver instance called".  It should have been 3 "driver instance called" and once any of thread closes only then new should start but that happening. I am failing to debug it.

Thanks !!
On Tuesday, July 24, 2018 at 4:32:03 PM UTC+5:30, [hidden email] wrote:
Hi Akash,

I tried with it, still facing same thing. To be very accurate : as soon as first @Test pass or complete, another thread starts . Test are running fine in their individual threads. 

On Tuesday, July 24, 2018 at 4:15:56 PM UTC+5:30, akash kansal wrote:
try after changing parallel to methods.

<test name="Charting" parallel="methods" thread-count="3">
 f

On Tue, Jul 24, 2018 at 3:36 PM, <[hidden email]> wrote:
Hi,

My thread-count is set to 3 but more all threads are starting at once.

Earlier design: One @Test per class that are running in parallel. 3 threads start in parallel and one ends only then new thread starts.

Current design: Multiple @Test per class that are running in parallel. Execution starts with 3 threads but soon after that one by one all threads open .

Here is testng.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;">http://testng.org/testng-1.0.dtd">
<suite name="Suite" configfailurepolicy="continue">
    <listeners>
        <listener class-name="ipd.listeners.implementation.TestListener"></listener>
    </listeners>

    <test name="Charting" parallel="classes" thread-count="3">
        <classes>
            <class name="class 1" />
            <class name="class 2" />
            <class name="class 3" />
            <class name="class 4" />
            <class name="class 5" />
            <class name="class 6 />
            <class name="class 7" />
        </classes>
    </test>
</suite>

Here is test class :

public class BarChart extends Charts {
   
    /* load property file and navigate to analytics page. */
    @BeforeClass
    public void load() throws IOException {
        loadChart("barchart");
    }

    @Test(priority = 0)
    public void parameter1()
            throws InterruptedException {
        makechart();
    }

    @Test(priority = 1)
    public void parameter2()
            throws InterruptedException {
       makechart();
    }

    @Test(priority = 2)
    public void parameter3()
            throws InterruptedException {
        makechart();
    }
}

Thanks !!

--
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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" 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" rel="nofollow" target="_blank" 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.

parallel threads.PNG (164K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Thread-count is set to 3 in testng.xml, but all threads are starting at once.

akash kansal
Hi Garvit,

Please remove the priority and they will work fine.

As testng is executing the @test based on the priority.

during run time the configuration gets saved based on the @test priority instead of classes.


On Tue, Jul 24, 2018 at 4:44 PM, <[hidden email]> wrote:

I have attached snapshot of my console output. Here are 5 class : BarChart, LineChart , BubbleChart, PieChart and StackedBar chart under package ipd.project.analytics.
I ran with each class having 3 @Test method.

In console output, as soon as 1st @Test pass, new thread starts. I printed "driver instance called".  It should have been 3 "driver instance called" and once any of thread closes only then new should start but that happening. I am failing to debug it.

Thanks !!

On Tuesday, July 24, 2018 at 4:32:03 PM UTC+5:30, [hidden email] wrote:
Hi Akash,

I tried with it, still facing same thing. To be very accurate : as soon as first @Test pass or complete, another thread starts . Test are running fine in their individual threads. 

On Tuesday, July 24, 2018 at 4:15:56 PM UTC+5:30, akash kansal wrote:
try after changing parallel to methods.

<test name="Charting" parallel="methods" thread-count="3">
 f

On Tue, Jul 24, 2018 at 3:36 PM, <[hidden email]> wrote:
Hi,

My thread-count is set to 3 but more all threads are starting at once.

Earlier design: One @Test per class that are running in parallel. 3 threads start in parallel and one ends only then new thread starts.

Current design: Multiple @Test per class that are running in parallel. Execution starts with 3 threads but soon after that one by one all threads open .

Here is testng.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" configfailurepolicy="continue">
    <listeners>
        <listener class-name="ipd.listeners.implementation.TestListener"></listener>
    </listeners>

    <test name="Charting" parallel="classes" thread-count="3">
        <classes>
            <class name="class 1" />
            <class name="class 2" />
            <class name="class 3" />
            <class name="class 4" />
            <class name="class 5" />
            <class name="class 6 />
            <class name="class 7" />
        </classes>
    </test>
</suite>

Here is test class :

public class BarChart extends Charts {
   
    /* load property file and navigate to analytics page. */
    @BeforeClass
    public void load() throws IOException {
        loadChart("barchart");
    }

    @Test(priority = 0)
    public void parameter1()
            throws InterruptedException {
        makechart();
    }

    @Test(priority = 1)
    public void parameter2()
            throws InterruptedException {
       makechart();
    }

    @Test(priority = 2)
    public void parameter3()
            throws InterruptedException {
        makechart();
    }
}

Thanks !!

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

--
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: Thread-count is set to 3 in testng.xml, but all threads are starting at once.

garvita girotra
Thanks a lot. It works well without priority. I can not use dependencies because i want test to continue if one fails . But at same time i need to preserve order of test. So i defined all test name in testng.xml in include tag. 

On Tuesday, July 24, 2018 at 6:02:42 PM UTC+5:30, akash kansal wrote:
Hi Garvit,

Please remove the priority and they will work fine.

As testng is executing the @test based on the priority.

during run time the configuration gets saved based on the @test priority instead of classes.


On Tue, Jul 24, 2018 at 4:44 PM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="6p6t6ETaBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">garvitag...@...> wrote:

I have attached snapshot of my console output. Here are 5 class : BarChart, LineChart , BubbleChart, PieChart and StackedBar chart under package ipd.project.analytics.
I ran with each class having 3 @Test method.

In console output, as soon as 1st @Test pass, new thread starts. I printed "driver instance called".  It should have been 3 "driver instance called" and once any of thread closes only then new should start but that happening. I am failing to debug it.

Thanks !!

On Tuesday, July 24, 2018 at 4:32:03 PM UTC+5:30, [hidden email] wrote:
Hi Akash,

I tried with it, still facing same thing. To be very accurate : as soon as first @Test pass or complete, another thread starts . Test are running fine in their individual threads. 

On Tuesday, July 24, 2018 at 4:15:56 PM UTC+5:30, akash kansal wrote:
try after changing parallel to methods.

<test name="Charting" parallel="methods" thread-count="3">
 f

On Tue, Jul 24, 2018 at 3:36 PM, <[hidden email]> wrote:
Hi,

My thread-count is set to 3 but more all threads are starting at once.

Earlier design: One @Test per class that are running in parallel. 3 threads start in parallel and one ends only then new thread starts.

Current design: Multiple @Test per class that are running in parallel. Execution starts with 3 threads but soon after that one by one all threads open .

Here is testng.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;">http://testng.org/testng-1.0.dtd">
<suite name="Suite" configfailurepolicy="continue">
    <listeners>
        <listener class-name="ipd.listeners.implementation.TestListener"></listener>
    </listeners>

    <test name="Charting" parallel="classes" thread-count="3">
        <classes>
            <class name="class 1" />
            <class name="class 2" />
            <class name="class 3" />
            <class name="class 4" />
            <class name="class 5" />
            <class name="class 6 />
            <class name="class 7" />
        </classes>
    </test>
</suite>

Here is test class :

public class BarChart extends Charts {
   
    /* load property file and navigate to analytics page. */
    @BeforeClass
    public void load() throws IOException {
        loadChart("barchart");
    }

    @Test(priority = 0)
    public void parameter1()
            throws InterruptedException {
        makechart();
    }

    @Test(priority = 1)
    public void parameter2()
            throws InterruptedException {
       makechart();
    }

    @Test(priority = 2)
    public void parameter3()
            throws InterruptedException {
        makechart();
    }
}

Thanks !!

--
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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" 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" rel="nofollow" target="_blank" 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="6p6t6ETaBgAJ" 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="6p6t6ETaBgAJ" 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.