[Webtest] Webtest parallel - where to use ? Mike's example

Mike B Mike B <mikebigg@yahoo.com>
Fri, 21 Dec 2007 01:14:08 -0800 (PST)


--0-106557891-1198228448=:68207
Content-Type: text/plain; charset=us-ascii

Willi / all,

You're correct - my mistake.  Each task inside the <parallel> element is a new thread.  My example only had one task (and therefor one thread) per test.  In my previous example, removing the </Parallel><Parellel> pairs should result in multiple threads executing at the same time.  

And so I see the errors you were seeing Willi. There are two kinds: runtime and reporting time. The runtime errors appear to be overriding non-uniquely named data:

Overriding previous definition of reference to ant.PropertyHelper
Overriding previous definition of reference to step
Overriding previous definition of reference to step
Overriding previous definition of reference to step
Overriding previous definition of reference to response
Overriding previous definition of reference to response
Overriding previous definition of reference to response
Overriding previous definition of reference to document
Overriding previous definition of reference to document
Overriding previous definition of reference to document
Overriding previous definition of reference to step
Overriding previous definition of reference to response
Overriding previous definition of reference to document
Overriding previous definition of reference to step


The reporting mechanism for webtest doesn't seem to be multi-threaded and there is race condition to write the summary report(s).

[iteration wrapper] ERROR (com.canoo.webtest.ant.WebtestTask) - Exception caught while writing test
report
[iteration wrapper] java.util.NoSuchElementException
[iteration wrapper]     at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1098)
[iteration wrapper]     at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)
[iteration wrapper]     at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)
 [parallel]     at java.util.TreeMap.buildFromSorted(TreeMap.java:2372)
 [parallel]     at java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
 [parallel]     at java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
 [parallel]     at java.util.TreeMap.buildFromSorted(TreeMap.java:2322)
 [parallel]     at java.util.TreeMap.putAll(TreeMap.java:296)
 [parallel]     at java.util.TreeMap.<init>(TreeMap.java:162)
 [parallel]     at com.canoo.webtest.reporting.XmlResultConverter.addSingleTask(XmlResultConverter.java:162)


More information on Ant task Parallel found here.

It would seem that, for now, Hesteric Roman and Stephen de Vries are current correct.

Mike

----- Original Message ----
From: Willi Kuhnis <wkuehnis@gmail.com>
To: webtest@lists.canoo.com
Sent: Friday, December 21, 2007 9:15:46 AM
Subject: [Webtest] Webtest parallel - where to use ? Mike's example

Hi Mike,
thanks for your tip.
Your example is exactly the style a wanted to use.
But :
I think there works nothing parallel !
I think, only the parts in between one <Parallel>    </parallel> statement works parallel.

Now you have 4 jobs and all this 4 jobs works sequentiell.

What do you think ?


*********************
Willi / all,

I was able to execute a parallel test with the following ant target example. I hope it helps.


Description: starts four ant tasks with web tests.  Each test repeats 10 times and keeps a counter. then prints the value and exits the task.  I had not problems using this.

<target name="experiment2">

    <parallel>
       <webtest name="Parallel-1" description="experiment with parallel tests">
         &configuration; <!-- <config> block, you probably don't need this line to try this test -->

         <steps>
            <repeat count="10">
                <scriptStep description="js1" language="javascript">
                   var i = step.getWebtestProperty
('JSPropertyCount1')
                   i++;
                   step.setWebtestProperty('JSPropertyCount1', i);
                </scriptStep>
            </repeat>
            <echo message="Count(1): #{JSPropertyCount1}"/>

         </steps>
       </webtest>
    </parallel>
    <parallel>
       <webtest name="Parallel-2" description="experiment with parallel tests">
         &configuration;

         <steps>
            <repeat count="10">
                <scriptStep description="js1" language="javascript">
                   var i = step.getWebtestProperty
('JSPropertyCount2')
                   i++;
                   step.setWebtestProperty('JSPropertyCount2', i);
                </scriptStep>
            </repeat>
            <echo message="Count(2): #{JSPropertyCount2}"/>

         </steps>
       </webtest>
    </parallel>
    <parallel>
       <webtest name="Parallel-3" description="experiment with parallel tests">
         &configuration;

         <steps>
            <repeat count="10">
                <scriptStep description="js1" language="javascript">
                   var i = step.getWebtestProperty
('JSPropertyCount3')
                   i++;
                   step.setWebtestProperty('JSPropertyCount3', i);
                </scriptStep>
            </repeat>
            <echo message="Count(3): #{JSPropertyCount3}"/>

         </steps>
       </webtest>
    </parallel>
    <parallel>
       <webtest name="Parallel-4" description="experiment with parallel tests">
         &configuration;

         <steps>
            <repeat count="10">
                <scriptStep description="js1" language="javascript">
                   var i = step.getWebtestProperty
('JSPropertyCount4')
                   i++;
                   step.setWebtestProperty('JSPropertyCount4', i);
                </scriptStep>
            </repeat>
            <echo message="Count(4): {JSPropertyCount4}"/>

         </steps>
       </webtest>
    </parallel>
  </target>


Mike

----- Original Message ----
From: Willi Kuhnis <wkuehnis@gmail.com
>
To: webtest@lists.canoo.com
Sent: Thursday, December 20, 2007 11:55:18 AM
Subject: [Webtest] Webtest parallel - where to use ?

Hi, 
I want to make a stress test.

I think, I could use parallel for this reason.
But now I didnt find out a constellation, which works.
When I use the <Parallel>-function inside the <Webtest>,
then I get a error-message.

Did somebody use it ?

I tried it now on many different ways - without success.

Also the following configuration dont work:

<project name="ABC" default="test">

    <target name="test">

            <parallel>
                 <webtest name="Test 1">
                       ... do someting
                 </webtest>
                 <webtest name="Test 2">


                       ... do someting
                 </webtest>
        </parallel>
    </target>
</project>

Thanks for any tips.

-- 
Willi Kuhnis


wkuehnis@gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
--0-106557891-1198228448=:68207
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:10pt"><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 10pt;">Willi / all,<br><br>You're correct - my mistake.&nbsp; Each task inside the &lt;parallel&gt; element is a new thread.&nbsp; My example only had one task (and therefor one thread) per test.&nbsp; In my previous example, removing the <span style="font-weight: bold;">&lt;/Parallel&gt;&lt;Parellel&gt;</span> pairs should result in multiple threads executing at the same time.&nbsp; <br><br>And so I see the errors you were seeing Willi. There are two kinds: runtime and reporting time. The runtime errors appear to be overriding non-uniquely named data:<br><br><div style="margin-left: 40px; font-style: italic;"><font size="1">Overriding previous definition of reference to ant.PropertyHelper<br>Overriding previous definition of
 reference to step<br>Overriding previous definition of reference to step<br>Overriding previous definition of reference to step<br>Overriding previous definition of reference to response<br>Overriding previous definition of reference to response<br>Overriding previous definition of reference to response<br>Overriding previous definition of reference to document<br>Overriding previous definition of reference to document<br>Overriding previous definition of reference to document<br>Overriding previous definition of reference to step<br>Overriding previous definition of reference to response<br>Overriding previous definition of reference to document<br>Overriding previous definition of reference to step</font><br></div><br>The reporting mechanism for webtest doesn't seem to be multi-threaded and there is race condition to write the summary report(s).<br><br><div style="margin-left: 40px;">[iteration wrapper] ERROR (com.canoo.webtest.ant.WebtestTask) -
 Exception caught while writing test<br>report<br>[iteration wrapper] java.util.NoSuchElementException<br>[iteration wrapper]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1098)<br>[iteration wrapper]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)<br>[iteration wrapper]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)<br>&nbsp;[parallel]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap.buildFromSorted(TreeMap.java:2372)<br>&nbsp;[parallel]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap.buildFromSorted(TreeMap.java:2396)<br>&nbsp;[parallel]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap.buildFromSorted(TreeMap.java:2396)<br>&nbsp;[parallel]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap.buildFromSorted(TreeMap.java:2322)<br>&nbsp;[parallel]&nbsp;&nbsp;&nbsp;&nbsp; at java.util.TreeMap.putAll(TreeMap.java:296)<br>&nbsp;[parallel]&nbsp;&nbsp;&nbsp;&nbsp;
 at java.util.TreeMap.&lt;init&gt;(TreeMap.java:162)<br>&nbsp;[parallel]&nbsp;&nbsp;&nbsp;&nbsp; at com.canoo.webtest.reporting.XmlResultConverter.addSingleTask(XmlResultConverter.java:162)<br></div><br>More information on Ant task <a href="http://ant.apache.org/manual/CoreTasks/parallel.html">Parallel </a>found <a href="http://ant.apache.org/manual/CoreTasks/parallel.html">here</a>.<br><br>It would seem that, for now, <span>Hesteric Roman and </span><span>Stephen de Vries are current correct.</span><br><br>Mike<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Willi Kuhnis &lt;wkuehnis@gmail.com&gt;<br>To: webtest@lists.canoo.com<br>Sent: Friday, December 21, 2007 9:15:46 AM<br>Subject: [Webtest] Webtest parallel - where to use ? Mike's example<br><br><a rel="nofollow" ymailto="mailto:webtest@lists.canoo.com" target="_blank" href="mailto:webtest@lists.canoo.com"></a><pre>Hi
 Mike,<br>thanks for your tip.<br>Your example is exactly the style a wanted to use.<br>But :<br>I think there works nothing parallel !<br>I think, only the parts in between one &lt;Parallel&gt;    &lt;/parallel&gt; statement works parallel.<br><br>Now you have 4 jobs and all this 4 jobs works sequentiell.<br><br>What do you think ?<br><br><br>*********************<br>Willi / all,<br><br>I was able to execute a parallel test with the following ant target example. I hope it helps.<br><br><br>Description: starts four ant tasks with web tests.  Each test repeats 10 times and keeps a counter. then prints the value and exits the task.  I had not problems using this.<br><br>&lt;target name="experiment2"&gt;<br><br>    &lt;parallel&gt;<br>       &lt;webtest name="Parallel-1" description="experiment with parallel tests"&gt;<br>         &amp;configuration; &lt;!-- &lt;config&gt; block, you probably don't need this line to try this test --&gt;<br><br>        
 &lt;steps&gt;<br>            &lt;repeat count="10"&gt;<br>                &lt;scriptStep description="js1" language="javascript"&gt;<br>                   var i = step.getWebtestProperty<br>('JSPropertyCount1')<br>                   i++;<br>                   step.setWebtestProperty('JSPropertyCount1', i);<br>                &lt;/scriptStep&gt;<br>            &lt;/repeat&gt;<br>            &lt;echo message="Count(1): #{JSPropertyCount1}"/&gt;<br><br>         &lt;/steps&gt;<br>       &lt;/webtest&gt;<br>    &lt;/parallel&gt;<br>    &lt;parallel&gt;<br>       &lt;webtest name="Parallel-2" description="experiment with parallel tests"&gt;<br>         &amp;configuration;<br><br>         &lt;steps&gt;<br>            &lt;repeat count="10"&gt;<br>                &lt;scriptStep description="js1" language="javascript"&gt;<br>                   var i = step.getWebtestProperty<br>('JSPropertyCount2')<br>                   i++;<br>                  
 step.setWebtestProperty('JSPropertyCount2', i);<br>                &lt;/scriptStep&gt;<br>            &lt;/repeat&gt;<br>            &lt;echo message="Count(2): #{JSPropertyCount2}"/&gt;<br><br>         &lt;/steps&gt;<br>       &lt;/webtest&gt;<br>    &lt;/parallel&gt;<br>    &lt;parallel&gt;<br>       &lt;webtest name="Parallel-3" description="experiment with parallel tests"&gt;<br>         &amp;configuration;<br><br>         &lt;steps&gt;<br>            &lt;repeat count="10"&gt;<br>                &lt;scriptStep description="js1" language="javascript"&gt;<br>                   var i = step.getWebtestProperty<br>('JSPropertyCount3')<br>                   i++;<br>                   step.setWebtestProperty('JSPropertyCount3', i);<br>                &lt;/scriptStep&gt;<br>            &lt;/repeat&gt;<br>            &lt;echo message="Count(3): #{JSPropertyCount3}"/&gt;<br><br>         &lt;/steps&gt;<br>       &lt;/webtest&gt;<br>    &lt;/parallel&gt;<br>   
 &lt;parallel&gt;<br>       &lt;webtest name="Parallel-4" description="experiment with parallel tests"&gt;<br>         &amp;configuration;<br><br>         &lt;steps&gt;<br>            &lt;repeat count="10"&gt;<br>                &lt;scriptStep description="js1" language="javascript"&gt;<br>                   var i = step.getWebtestProperty<br>('JSPropertyCount4')<br>                   i++;<br>                   step.setWebtestProperty('JSPropertyCount4', i);<br>                &lt;/scriptStep&gt;<br>            &lt;/repeat&gt;<br>            &lt;echo message="Count(4): {JSPropertyCount4}"/&gt;<br><br>         &lt;/steps&gt;<br>       &lt;/webtest&gt;<br>    &lt;/parallel&gt;<br>  &lt;/target&gt;<br><br><br>Mike<br><br>----- Original Message ----<br>From: Willi Kuhnis &lt;<a rel="nofollow" ymailto="mailto:wkuehnis@gmail.com" target="_blank" href="mailto:wkuehnis@gmail.com">wkuehnis@gmail.com<br></a>&gt;<br>To: <a rel="nofollow"
 ymailto="mailto:webtest@lists.canoo.com" target="_blank" href="mailto:webtest@lists.canoo.com">webtest@lists.canoo.com</a><br>Sent: Thursday, December 20, 2007 11:55:18 AM<br>Subject: [Webtest] Webtest parallel - where to use ?<br><br>Hi, <br>I want to make a stress test.<br><br>I think, I could use parallel for this reason.<br>But now I didnt find out a constellation, which works.<br>When I use the &lt;Parallel&gt;-function inside the &lt;Webtest&gt;,<br>then I get a error-message.<br><br>Did somebody use it ?<br><br>I tried it now on many different ways - without success.<br><br>Also the following configuration dont work:<br><br>&lt;project name="ABC" default="test"&gt;<br><br>    &lt;target name="test"&gt;<br><br>            &lt;parallel&gt;<br>                 &lt;webtest name="Test 1"&gt;<br>                       ... do someting<br>                 &lt;/webtest&gt;<br>                 &lt;webtest name="Test 2"&gt;<br><br><br>                      
 ... do someting<br>                 &lt;/webtest&gt;<br>        &lt;/parallel&gt;<br>    &lt;/target&gt;<br>&lt;/project&gt;<br><br>Thanks for any tips.<br><br>-- <br>Willi Kuhnis<br><br><a rel="nofollow" ymailto="mailto:wkuehnis@gmail.com" target="_blank" href="mailto:wkuehnis@gmail.com"><br>wkuehnis@gmail.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</pre>
</div><br></div></div><br>
      <hr size=1>Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a></body></html>
--0-106557891-1198228448=:68207--