directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <>
Subject Re: Server-integ tests are taking way too long...
Date Sat, 25 May 2013 13:37:13 GMT
On 25.05.2013 15:04, Emmanuel Lécharny wrote:
> Le 5/25/13 2:01 PM, Stefan Seelmann a écrit :
>> On 25.05.2013 12:14, Emmanuel Lécharny wrote:
>>> The PasswordPolicy tests are expensive because they need to sleep to
>>> check some time condition. At this point, I'm wondering if it would not
>>> worth creating a separate module for it.
>> Hm, maybe we can avoid using the "real" time (via
>> System.currentTimeMillis) and use a "time provider" instead. By default
>> it obtails the system time. But for tests the returned time can be
>> modified according to the test needs. JodaTime for example has a
>> DateTimeUtils class with static accessors for getting and setting the
>> time. In other projects we used a TimeProvider interface with different
>> implementations for production and tests.
> That would be an extremely useful thing. I think we can benefit from
> such an addition for the replication tests, especially those which are
> time dependents. We can even simuate some use cases that are time
> dependent this way.

In the apacheds project we have 81 occurrences of Thread.sleep and 347
occurrences of System.currentTimeMillis. I can try to find some time
this weekend to find out if and how it can be used, starting with the PP

Kind Regards,

View raw message