On 19/09/2008, sebb <[EMAIL PROTECTED]> wrote:
> On 28/08/2008, Nadav Samet <[EMAIL PROTECTED]> wrote:
>  > That's weird.
>  >
>  >  So I was trying to debug what's going on. It seems like HTTPSamplerBase
>  >  caches the file list, so it's not aware that the filenames should change
>  >  between subsequent iterations. In HTTPSamplerBase around line 1548:
>  >
>  >         if (fileList != null){
>  >             return fileList;
>  >         }
>  >
>  >  When I comment the above lines out, I am getting a fresh value in each
>  >  iteration. Any ideas?
>
>
> I think the cache was added to save the possibly expensive process of
>  regenerating the list.  Unfortunately any variables are resolved when
>  the list is created.
>
>  This obviously needs to be revisited.
>

I think I've fixed the problem - the first file name is now resolved
at run-time (filenames after the first were OK previously)

If you want to try it, nightly builds after r697636 have the fix.

>  >
>  >  -Nadav
>  >
>  >
>  >
>  >  On Fri, Aug 22, 2008 at 1:50 PM, Nadav Samet <[EMAIL PROTECTED]> wrote:
>  >
>  >  > I have tried this against both 2.3.2 and trunk. I have attached a 
> minimal
>  >  > example in which this problem occurs.
>  >  >
>  >  > I've discovered that if I add an additional file to the sampler, then 
> the
>  >  > counter will work right on the second file, but is frozen on the initial
>  >  > value for the first file. Perhaps this bug popped up after the 
> HTTPFileArgs
>  >  > feature had been introduced?
>  >  >
>  >  > -Nadav
>  >  >
>  >  >
>  >  > On Thu, Aug 21, 2008 at 8:35 PM, Ryan Miling <[EMAIL PROTECTED]> wrote:
>  >  >
>  >  >> I cannot reproduce this error. I set-up my test plan exactly like yours
>  >  >> and was able to send the files
>  >  >> 'myfile0.txt','myfile1.txt',...,'myfile9.txt' along with the HTTP
>  >  >> Request. Like you, I had done this...
>  >  >>
>  >  >> + Thread Group
>  >  >> ++ Loop Controller
>  >  >> +++ Counter
>  >  >> +++ HTTP Request
>  >  >> +++ Debug Sampler
>  >  >> ++ View Results Tree
>  >  >>
>  >  >> ...except I threw on a Debug Sampler and View Results Tree to see what
>  >  >> was going on. You do have the most recent version of JMeter, correct?
>  >  >>
>  >  >>
>  >  >> > -----Original Message-----
>  >  >> > From: Nadav Samet [mailto:[EMAIL PROTECTED]
>  >  >> > Sent: Thursday, August 21, 2008 3:24 PM
>  >  >> > To: jmeter-user@jakarta.apache.org
>  >  >> > Subject: Counter within a loop
>  >  >> >
>  >  >> > Hi there,
>  >  >> >
>  >  >> > I am trying to create a loop that each iteration would initiate a
>  >  >> request.
>  >  >> > One field in the request (the file to send) varies with each
>  >  >> iteration.
>  >  >> >
>  >  >> > This is how I set it up:
>  >  >> >
>  >  >> > + ThreadGroup
>  >  >> > ++ Loop controller      (Loop Count = 10)
>  >  >> > +++ Counter  (Start=0, increment=1, max=100000, reference name=index)
>  >  >> > +++ Request   (Send files with the request: myfile${index}).txt)
>  >  >> >
>  >  >> > It turns out that it does loop 10 times, but it sends myfile0.txt on
>  >  >> all
>  >  >> > iterations, instead of the different 10 files I've prepared. Does it
>  >  >> do
>  >  >> > the
>  >  >> > string interpolation on the file name too early? What's the right way
>  >  >> to
>  >  >> > do
>  >  >> > it?
>  >  >> >
>  >  >> > --
>  >  >> > Thanks,
>  >  >> > Nadav
>  >  >>
>  >  >> ---------------------------------------------------------------------
>  >  >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>  >  >> For additional commands, e-mail: [EMAIL PROTECTED]
>  >  >>
>  >  >>
>  >  >
>  >  >
>  >  > --
>  >  > Sincerely yours,
>  >  > Nadav
>  >  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to