[Webtest] RE: Memory Lean in Canoo

Rob Manthey Rob Manthey <canoo@rob.manthey.id.au>
Wed, 06 Dec 2006 17:31:31 +1000


Well.  I wish it worked for me. 
If the  <property name="alreadySetUp" value="true"/>  is *inside* the  
<target name="doSetUp" unless="alreadySetUp">  then isn't the property 
only in scope for the duration of the target?  That's how mine behaves?  
I have included an echo in the target and sure enough it blurts out the 
echo each time another target is called, so it appears that the 
alreadySetUp property fails to persist after the target is completed, 
and the doSetUp target runs in full every time another target is called.
If the  <property name="alreadySetUp" value="true"/>  is *outside* the  
<target name="doSetUp" unless="alreadySetUp">  then isn't the property 
set to true before the target is run for the first time?  That's how 
mine behaves?  Sure enough it bombs on "Could not create task or type of 
type: webtest", so it appears that the alreadySetUp property preempts 
the doSetUp target call and it never happens.
We might have to "show code" to figure this out, if noone has any other 
ideas.  Nate, can you put an echo in your doSetUp target and see if it 
*really* only runs once?  Otherwise I'm going to have to exorcise my pc, 
because it seems my code is cursed.
Rob

on 06/12/06 02:31 Nate Oster said the following:
> Rob,
> Sorry about that.  No, Ant will NOT automatically determine that the
> depends was only run once.
>
> Just declare the doSetup target like this:
> 	<target name="doSetUp" unless="alreadySetUp">
>
> After doSetup configures your path, variables, and Taskdef, include:
> 	<property name="alreadySetUp" value="true"/>
>
> That way, every WebTest target can depend on "doSetup", but the doSetup
> target will only run once.  This help you avoid OOM exceptions due to
> reloading the WebTest taskdef multiple times.
>
> Nate Oster
>
> Message: 4
> Date: Tue, 05 Dec 2006 15:41:02 +1000
> From: Rob Manthey <canoo@rob.manthey.id.au>
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] Re: Memory Leak in Canoo
> Reply-To: webtest@lists.canoo.com
> Reply-To: Rob Manthey <canoo@rob.manthey.id.au>
>
> This is a multi-part message in MIME format.
> --------------060906060409030806080106
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
>
> Sorry, I think you may have already answered my question with this ...
>
>     THEN, each target in a WebTest XML file checks that the doSetup was
>     already run using Ant's depends attribute, like this:
>     	<target name="Test No6" depends="doSetUp">
>
> Does ant's "depends" automatically ensure that doSetUp is only run once 
> no matter how many times it is called in a sequence of targets?  Why 
> then do you set a property of  <property name="alreadySetUp" 
> value="true"/> ?
>
> RM
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>