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 <[EMAIL PROTECTED]>
To: [email protected]
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 <[EMAIL PROTECTED]
>
To: [email protected]
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


[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Reply via email to