tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1415184 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java webapps/docs/changelog.xml
Date Sun, 02 Dec 2012 22:00:05 GMT
2012/11/29  <markt@apache.org>:
> Author: markt
> Date: Thu Nov 29 14:35:02 2012
> New Revision: 1415184
>
> URL: http://svn.apache.org/viewvc?rev=1415184&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54190
> Improve unit tests.
> Patch by Brian Burch.
>
> Modified:
>     tomcat/tc7.0.x/trunk/   (props changed)
>     tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
>     tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>
> Propchange: tomcat/tc7.0.x/trunk/
> ------------------------------------------------------------------------------
>   Merged /tomcat/trunk:r1415177-1415179
>

> +    private static final int SHORT_TIMEOUT_MINS = 1;
> +    private static final int LONG_TIMEOUT_MINS = 2;
> +    private static final int MANAGER_SCAN_DELAY_SECS = 60;
> +    private static final int EXTRA_DELAY_SECS = 5;
> +    private static final long TIMEOUT_DELAY_MSECS =
> +            (((SHORT_TIMEOUT_MINS * 60)
> +                    + MANAGER_SCAN_DELAY_SECS + EXTRA_DELAY_SECS) * 1000);

...

> +        // allow the session to time out and lose authentication
> +        Thread.sleep(TIMEOUT_DELAY_MSECS);


According to Buildbot logs, testBasicLoginSessionTimeout() runs for 2
minutes (125 seconds), mainly due to a sleep() call.

I wish there were a way to speed up this test.

My thoughts
a) Maybe use reflection to reduce StandardSession.lastAccessedTime and
thisAccessedTime by some fixed amount (60000) instead of waiting for
that time to pass.

b) Maybe call ManagerBase.setProcessExpiresFrequency(1) instead of the
default value (6)  and reduce MANAGER_SCAN_DELAY_SECS from 60 to 10.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message