Le 8/2/13 10:04 AM, Kiran Ayyagari a écrit : > On Fri, Aug 2, 2013 at 1:32 PM, Emmanuel Lécharny <[email protected]>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
