You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lécharny <el...@gmail.com> on 2013/08/02 09:20:15 UTC

Weird behavior in Server-integ tests

Hi guys,

there is something that is extremelly weird i server-integ test : we
have some kind of 1 second delay for each test we run. For instance,
when we run the SearchIT tests, any test is taking 1 second at least to
execute.

This should not be the case, because we don't inject a lot of entries.

I suspect that MINA is the culprit here : the select() loop is waiting 1
second before acting.

This slows down the tests a lot, as we have around 600 of them.

To be investigated...

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: Weird behavior in Server-integ tests

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 8/2/13 7:35 PM, Stefan Seelmann a écrit :
> On 08/02/2013 10:02 AM, Emmanuel Lécharny wrote:
>> Le 8/2/13 9:20 AM, Emmanuel Lécharny a écrit :
>>> Hi guys,
>>>
>>> there is something that is extremelly weird i server-integ test : we
>>> have some kind of 1 second delay for each test we run. For instance,
>>> when we run the SearchIT tests, any test is taking 1 second at least to
>>> execute.
>>>
>>> This should not be the case, because we don't inject a lot of entries.
>>>
>>> I suspect that MINA is the culprit here : the select() loop is waiting 1
>>> second before acting.
>>>
>>> This slows down the tests a lot, as we have around 600 of them.
>>>
>>> To be investigated...
>>>
>> After investigation, I found that the following line :
>>
>> public class SearchIT extends AbstractLdapTestUnit
>> {
>>     @Rule
>>     public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker(
>> MultiThreadedMultiInvoker.NOT_THREADSAFE );
>>
>> cause the delay.
>>
>> With this line, the SearchIT test runs in rouglhy 49 seconds, withhout
>> it, it runs in 13 seconds !
>>
>> The reason is that the MultiThreadMultiInvoker introduce a 1 second sleep :
>>
>>                 while(counter.get() > 0)
>>                 {
>>                     Thread.sleep( 1000 );
>>                 }
>> (line 187).
> Well, I must admit that the implementation of that class is not very
> smart, it uses runnables that count down a counter when they are done.
> When using Futures instead the counter and the sleep can be avoided.
> I'll try up fix that.
>
>> We shoumd probably get rid of this @rules, unless we have very good
>> reason to use it...
> Yes do so. They are helpful to find concurrency issues by running tests
> multiple times in parallel.

I have removed it when we use it for not thread safe tests, as I suspect
it's totally useless. Server integ now runs in 4 minutes instead of 12,
which is way better.

Thanks for the heads up Stefan !
>
> Kind Regards,
> Stefan
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: Weird behavior in Server-integ tests

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 08/02/2013 10:02 AM, Emmanuel Lécharny wrote:
> Le 8/2/13 9:20 AM, Emmanuel Lécharny a écrit :
>> Hi guys,
>>
>> there is something that is extremelly weird i server-integ test : we
>> have some kind of 1 second delay for each test we run. For instance,
>> when we run the SearchIT tests, any test is taking 1 second at least to
>> execute.
>>
>> This should not be the case, because we don't inject a lot of entries.
>>
>> I suspect that MINA is the culprit here : the select() loop is waiting 1
>> second before acting.
>>
>> This slows down the tests a lot, as we have around 600 of them.
>>
>> To be investigated...
>>
> After investigation, I found that the following line :
> 
> public class SearchIT extends AbstractLdapTestUnit
> {
>     @Rule
>     public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker(
> MultiThreadedMultiInvoker.NOT_THREADSAFE );
> 
> cause the delay.
> 
> With this line, the SearchIT test runs in rouglhy 49 seconds, withhout
> it, it runs in 13 seconds !
> 
> The reason is that the MultiThreadMultiInvoker introduce a 1 second sleep :
> 
>                 while(counter.get() > 0)
>                 {
>                     Thread.sleep( 1000 );
>                 }
> (line 187).

Well, I must admit that the implementation of that class is not very
smart, it uses runnables that count down a counter when they are done.
When using Futures instead the counter and the sleep can be avoided.
I'll try up fix that.

> We shoumd probably get rid of this @rules, unless we have very good
> reason to use it...

Yes do so. They are helpful to find concurrency issues by running tests
multiple times in parallel.

Kind Regards,
Stefan


Re: Weird behavior in Server-integ tests

Posted by Pierre-Arnaud Marcelot <pa...@marcelot.net>.
Yay !

Regards,
Pierre-Arnaud

On 2 août 2013, at 10:54, Emmanuel Lécharny <el...@gmail.com> wrote:

> I have removed the MiltiThreadMultiInvoker from the server-integ tests,
> and I'm able to run server-integ in 4 mins instead of 15 !
> 
> 
> -- 
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com 
> 


Re: Weird behavior in Server-integ tests

Posted by Kiran Ayyagari <ka...@apache.org>.
\o/ really nice


On Fri, Aug 2, 2013 at 2:24 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> I have removed the MiltiThreadMultiInvoker from the server-integ tests,
> and I'm able to run server-integ in 4 mins instead of 15 !
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>


-- 
Kiran Ayyagari
http://keydap.com

Re: Weird behavior in Server-integ tests

Posted by Emmanuel Lécharny <el...@gmail.com>.
I have removed the MiltiThreadMultiInvoker from the server-integ tests,
and I'm able to run server-integ in 4 mins instead of 15 !


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: Weird behavior in Server-integ tests

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 8/2/13 10:04 AM, Kiran Ayyagari a écrit :
> On Fri, Aug 2, 2013 at 1:32 PM, Emmanuel Lécharny <el...@gmail.com>wrote:
>
>> Le 8/2/13 9:20 AM, Emmanuel Lécharny a écrit :
>>> Hi guys,
>>>
>>> there is something that is extremelly weird i server-integ test : we
>>> have some kind of 1 second delay for each test we run. For instance,
>>> when we run the SearchIT tests, any test is taking 1 second at least to
>>> execute.
>>>
>>> This should not be the case, because we don't inject a lot of entries.
>>>
>>> I suspect that MINA is the culprit here : the select() loop is waiting 1
>>> second before acting.
>>>
>>> This slows down the tests a lot, as we have around 600 of them.
>>>
>>> To be investigated...
>>>
>> After investigation, I found that the following line :
>>
>> public class SearchIT extends AbstractLdapTestUnit
>> {
>>     @Rule
>>     public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker(
>> MultiThreadedMultiInvoker.NOT_THREADSAFE );
>>
>> cause the delay.
>>
>> With this line, the SearchIT test runs in rouglhy 49 seconds, withhout
>> it, it runs in 13 seconds !
>>
>> The reason is that the MultiThreadMultiInvoker introduce a 1 second sleep :
>>
>>                 while(counter.get() > 0)
>>                 {
>>                     Thread.sleep( 1000 );
>>                 }
>> (line 187).
>>
>> We shoumd probably get rid of this @rules, unless we have very good
>> reason to use it...
>>
>> AFAIR they were added to speed up tests, and now ironically they are
> slowing them down ;)

No, it was introduced to detect some concurrent issues in StartTLS
(Stefan needed it at some point).

Now, I think this may cause some problems in tests. We have had some
random failures on CollectiveAttributesIT with JDBM, and when we run the
tests with Mavibot, which is 3 to 10 times faster than JDBM, we have
more random failures in many tests.

I will remove the MultiThreadMultiInvoker rule when it's declared as
NOT_THREAD_SAFE to see what I get.



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Re: Weird behavior in Server-integ tests

Posted by Kiran Ayyagari <ka...@apache.org>.
On Fri, Aug 2, 2013 at 1:32 PM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 8/2/13 9:20 AM, Emmanuel Lécharny a écrit :
> > Hi guys,
> >
> > there is something that is extremelly weird i server-integ test : we
> > have some kind of 1 second delay for each test we run. For instance,
> > when we run the SearchIT tests, any test is taking 1 second at least to
> > execute.
> >
> > This should not be the case, because we don't inject a lot of entries.
> >
> > I suspect that MINA is the culprit here : the select() loop is waiting 1
> > second before acting.
> >
> > This slows down the tests a lot, as we have around 600 of them.
> >
> > To be investigated...
> >
> After investigation, I found that the following line :
>
> public class SearchIT extends AbstractLdapTestUnit
> {
>     @Rule
>     public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker(
> MultiThreadedMultiInvoker.NOT_THREADSAFE );
>
> cause the delay.
>
> With this line, the SearchIT test runs in rouglhy 49 seconds, withhout
> it, it runs in 13 seconds !
>
> The reason is that the MultiThreadMultiInvoker introduce a 1 second sleep :
>
>                 while(counter.get() > 0)
>                 {
>                     Thread.sleep( 1000 );
>                 }
> (line 187).
>
> We shoumd probably get rid of this @rules, unless we have very good
> reason to use it...
>
> AFAIR they were added to speed up tests, and now ironically they are
slowing them down ;)


>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>


-- 
Kiran Ayyagari
http://keydap.com

Re: Weird behavior in Server-integ tests

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 8/2/13 9:20 AM, Emmanuel Lécharny a écrit :
> Hi guys,
>
> there is something that is extremelly weird i server-integ test : we
> have some kind of 1 second delay for each test we run. For instance,
> when we run the SearchIT tests, any test is taking 1 second at least to
> execute.
>
> This should not be the case, because we don't inject a lot of entries.
>
> I suspect that MINA is the culprit here : the select() loop is waiting 1
> second before acting.
>
> This slows down the tests a lot, as we have around 600 of them.
>
> To be investigated...
>
After investigation, I found that the following line :

public class SearchIT extends AbstractLdapTestUnit
{
    @Rule
    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker(
MultiThreadedMultiInvoker.NOT_THREADSAFE );

cause the delay.

With this line, the SearchIT test runs in rouglhy 49 seconds, withhout
it, it runs in 13 seconds !

The reason is that the MultiThreadMultiInvoker introduce a 1 second sleep :

                while(counter.get() > 0)
                {
                    Thread.sleep( 1000 );
                }
(line 187).

We shoumd probably get rid of this @rules, unless we have very good
reason to use it...




-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com