tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Burch <>
Subject Re: [Bug 54190] TestNonLoginAndBasicAuthenticator does not test session timeout properly
Date Thu, 22 Nov 2012 19:27:19 GMT
On 22/11/12 18:39, Mark Thomas wrote:
> On 22/11/2012 17:32, Brian Burch wrote:
>> On 22/11/12 16:46, wrote:
>>> --- Comment #3 from Mark Thomas <> ---
>>> Your logic makes sense to me so my preference would be some more
>>> comments.
>> I will think about our discussion and try to improve the comments and so
>> hopefully avoid confusing future readers. I will submit a new
>> self-contained patch and obsolete the current one.
>> Sorry to drift slightly (but not completely) off-topic. Could you give
>> me your off-the-cuff opinion on this:
>> Context.setSessionTimeout(int timeoutInMinutes) obliges tests that need
>> to explore session timeout behaviour to hang the test process for at
>> least 60 seconds, although most of that delay would be unnecessary.
>> I don't actually know how often the Manager (is that the right
>> component?) scans to expire Sessions, but it must do it more frequently
>> than once a minute.
> It is the manager. It scans (goes to look up frequency) every 60 seconds
> by default (10s for background process * 6 for processExpiresFrequency)
>> I realise the method signature is part of a public api, but do you have
>> a view on adding an alternative method to
>> org.apache.catalina.core.StandardContext so that unit tests could set a
>> session timeout in seconds?
> I'm neutral. The delay doesn't really bother me. If you do go this way,
> you'll need to modify processExpiresFrequency for the Manager as well so
> checks happen more often.

Perfect answer, thanks! If the Manager by default is scanning every 60 
seconds, then it makes sense to live with a session timeout of 1 minute 
and a test case wait of about 70 seconds. That is what I am doing at the 
moment, and there isn't much point being clever unless a test suite is 
going to call for more than a few timeouts.

> Mark
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message