You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by UBIK LOAD PACK Support <su...@ubikloadpack.com> on 2016/03/14 15:34:32 UTC

GenericController#next() and GenericController#isDone()

Hello,
Can we consider it a contract that:

   -  if GenericController#next()  returns null, GenericController#isDone()
   must return true ?


Thank you

Regards

Re: GenericController#next() and GenericController#isDone()

Posted by sebb <se...@gmail.com>.
On 14 March 2016 at 16:25, UBIK LOAD PACK Support
<su...@ubikloadpack.com> wrote:
> Hello Sebb,
> Thanks for answer.
>
> So you would say it is not a contract ?

No, I'm not saying that it is not.
Nor am I saying that it is.
I don't know the answer.

> Although it seems logical.

I don't know about that either.

> If so, the change made by this commit (the one related to the
> JMeterThread#run() only):
> - http://svn.apache.org/viewvc?view=revision&revision=1720004
>
> Should be reverted to previous state as behaviour will be different between
> 2.13 and 3.0.
>
> With 2.13:
>
>    - If controller.next() returns null and controller.isDone() returns
>    false, the inner loop is exited but the outer loop will not be, if next
>    call to controller.next() returns true the inner loop restarts and run() is
>    not exited
>
>
> With 3.0 as of current nightly build:
>
>    - If controller.next() returns null and controller.isDone() returns
>    false, the loop is exited as long as run
>
>
>
> This probably explains the bug reported  by Andrei Pokhilko:
>
>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=59133
>
>
>
> Regards
>
>
>
> On Mon, Mar 14, 2016 at 4:15 PM, sebb <se...@gmail.com> wrote:
>
>> That area is by far the most complicated part of the JMeter code.
>>
>> It would need very careful examination and lots of unit tests to
>> determine if that is a valid assumption.
>>
>> I would start by amending your copy of the code to log a warning if
>> the assumption is not true.
>> Then try it with as many different test cases as you have.
>>
>>
>> On 14 March 2016 at 14:57, UBIK LOAD PACK Support
>> <su...@ubikloadpack.com> wrote:
>> > Hello,
>> > Because until current nightly, it was not enforced so it was possible to
>> > write such code.
>> >
>> > Regards
>> >
>> > On Monday, March 14, 2016, UBIK LOAD PACK Support <
>> support@ubikloadpack.com
>> > <javascript:_e(%7B%7D,'cvml','support@ubikloadpack.com');>> wrote:
>> >
>> >> Hello,
>> >> Can we consider it a contract that:
>> >>
>> >>    -  if GenericController#next()  returns null,
>> >>    GenericController#isDone() must return true ?
>> >>
>> >>
>> >> Thank you
>> >>
>> >> Regards
>> >>
>> >
>> >
>> > --
>> >
>> > Regards
>> > Ubik Load Pack <http://ubikloadpack.com> Team
>> > Follow us on Twitter <http://twitter.com/ubikloadpack>
>> >
>> >
>> > Cordialement
>> > L'équipe Ubik Load Pack <http://ubikloadpack.com>
>> > Suivez-nous sur Twitter <http://twitter.com/ubikloadpack>
>>

Re: GenericController#next() and GenericController#isDone()

Posted by UBIK LOAD PACK Support <su...@ubikloadpack.com>.
Hello Sebb,
Thanks for answer.

So you would say it is not a contract ? Although it seems logical.

If so, the change made by this commit (the one related to the
JMeterThread#run() only):
- http://svn.apache.org/viewvc?view=revision&revision=1720004

Should be reverted to previous state as behaviour will be different between
2.13 and 3.0.

With 2.13:

   - If controller.next() returns null and controller.isDone() returns
   false, the inner loop is exited but the outer loop will not be, if next
   call to controller.next() returns true the inner loop restarts and run() is
   not exited


With 3.0 as of current nightly build:

   - If controller.next() returns null and controller.isDone() returns
   false, the loop is exited as long as run



This probably explains the bug reported  by Andrei Pokhilko:

   - https://bz.apache.org/bugzilla/show_bug.cgi?id=59133



Regards



On Mon, Mar 14, 2016 at 4:15 PM, sebb <se...@gmail.com> wrote:

> That area is by far the most complicated part of the JMeter code.
>
> It would need very careful examination and lots of unit tests to
> determine if that is a valid assumption.
>
> I would start by amending your copy of the code to log a warning if
> the assumption is not true.
> Then try it with as many different test cases as you have.
>
>
> On 14 March 2016 at 14:57, UBIK LOAD PACK Support
> <su...@ubikloadpack.com> wrote:
> > Hello,
> > Because until current nightly, it was not enforced so it was possible to
> > write such code.
> >
> > Regards
> >
> > On Monday, March 14, 2016, UBIK LOAD PACK Support <
> support@ubikloadpack.com
> > <javascript:_e(%7B%7D,'cvml','support@ubikloadpack.com');>> wrote:
> >
> >> Hello,
> >> Can we consider it a contract that:
> >>
> >>    -  if GenericController#next()  returns null,
> >>    GenericController#isDone() must return true ?
> >>
> >>
> >> Thank you
> >>
> >> Regards
> >>
> >
> >
> > --
> >
> > Regards
> > Ubik Load Pack <http://ubikloadpack.com> Team
> > Follow us on Twitter <http://twitter.com/ubikloadpack>
> >
> >
> > Cordialement
> > L'équipe Ubik Load Pack <http://ubikloadpack.com>
> > Suivez-nous sur Twitter <http://twitter.com/ubikloadpack>
>

Re: GenericController#next() and GenericController#isDone()

Posted by sebb <se...@gmail.com>.
That area is by far the most complicated part of the JMeter code.

It would need very careful examination and lots of unit tests to
determine if that is a valid assumption.

I would start by amending your copy of the code to log a warning if
the assumption is not true.
Then try it with as many different test cases as you have.


On 14 March 2016 at 14:57, UBIK LOAD PACK Support
<su...@ubikloadpack.com> wrote:
> Hello,
> Because until current nightly, it was not enforced so it was possible to
> write such code.
>
> Regards
>
> On Monday, March 14, 2016, UBIK LOAD PACK Support <support@ubikloadpack.com
> <javascript:_e(%7B%7D,'cvml','support@ubikloadpack.com');>> wrote:
>
>> Hello,
>> Can we consider it a contract that:
>>
>>    -  if GenericController#next()  returns null,
>>    GenericController#isDone() must return true ?
>>
>>
>> Thank you
>>
>> Regards
>>
>
>
> --
>
> Regards
> Ubik Load Pack <http://ubikloadpack.com> Team
> Follow us on Twitter <http://twitter.com/ubikloadpack>
>
>
> Cordialement
> L'équipe Ubik Load Pack <http://ubikloadpack.com>
> Suivez-nous sur Twitter <http://twitter.com/ubikloadpack>

GenericController#next() and GenericController#isDone()

Posted by UBIK LOAD PACK Support <su...@ubikloadpack.com>.
Hello,
Because until current nightly, it was not enforced so it was possible to
write such code.

Regards

On Monday, March 14, 2016, UBIK LOAD PACK Support <support@ubikloadpack.com
<javascript:_e(%7B%7D,'cvml','support@ubikloadpack.com');>> wrote:

> Hello,
> Can we consider it a contract that:
>
>    -  if GenericController#next()  returns null,
>    GenericController#isDone() must return true ?
>
>
> Thank you
>
> Regards
>


-- 

Regards
Ubik Load Pack <http://ubikloadpack.com> Team
Follow us on Twitter <http://twitter.com/ubikloadpack>


Cordialement
L'équipe Ubik Load Pack <http://ubikloadpack.com>
Suivez-nous sur Twitter <http://twitter.com/ubikloadpack>