Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 82296D6C2 for ; Mon, 3 Dec 2012 18:22:42 +0000 (UTC) Received: (qmail 8988 invoked by uid 500); 3 Dec 2012 18:22:41 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 8928 invoked by uid 500); 3 Dec 2012 18:22:41 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 8917 invoked by uid 99); 3 Dec 2012 18:22:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 18:22:41 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of brian@pingtoo.com does not designate 217.154.193.216 as permitted sender) Received: from [217.154.193.216] (HELO mail2.pingtoo.com) (217.154.193.216) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 18:22:33 +0000 Received: from [10.1.252.200] (schizo.pingtoo.com [10.1.252.200]) by mail.pingtoo.com (Postfix) with ESMTPA id F2A4F134006 for ; Mon, 3 Dec 2012 18:22:12 +0000 (GMT) Message-ID: <50BCEDD4.8050303@pingtoo.com> Date: Mon, 03 Dec 2012 18:22:12 +0000 From: Brian Burch User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: dev@tomcat.apache.org Subject: Re: svn commit: r1415184 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java webapps/docs/changelog.xml References: <20121129143504.C4FCF23889E2@eris.apache.org> <50BC909C.5040200@pingtoo.com> <50BCD1AB.4010105@pingtoo.com> In-Reply-To: <50BCD1AB.4010105@pingtoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 03/12/12 16:22, Brian Burch wrote: > On 03/12/12 11:44, Brian Burch wrote: >> On 02/12/12 22:00, Konstantin Kolinko wrote: > >>> 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. >> >> That would speed up the test... but it sounds like adding a time machine >> to the test class! My feeling is this would add inappropriate logical >> complexity to a test that has always created and destroyed a tomcat >> instance for each test case (there are now 15). >> >> However, I intend to replicate most of the improvements from this test >> class into the other authenticator tests, so I am already apprehensive >> about adding too many 60+ second delays to the entire suite. >> >> Mark and I briefly discussed adding a new protected method for use by >> these timeout tests: >> >> org.apache.catalina.session.StandardSession.setSessionTimeoutSecs(int >> secs) > > Silly me! Sorry if that left you wondering what I meant. That particular > method already exists, is public, and is called setSessionTimeout. > > What I meant to suggest was this: > > org.apache.catalina.core.StandardContext.setSessionTimeoutSecs(int timeout) > > because it would be much simpler to modify the Context in the test > setUp, rather than each individual Session. > >> What do you think? The change seemed almost trivial to me, but I couldn't work out how to implement it without changing the public api, i.e. I have only found one place where it is used: org.apache.catalina.session.ManagerBase.setContext(Context context) has this logic: // Register with the new Context (if any) if (this.context != null) { setMaxInactiveInterval(this.context.getSessionTimeout() * 60); this.context.addPropertyChangeListener(this); } I wanted to move the "60" back into StandardContext, but that doesn't work because it means changing the org.apache.catalina.Context api to work in seconds instead of minutes. ManagerBase and StandardContext are in different packages, so a protected accessor for the timeout in seconds wouldn't work either. On the other hand, I wondered about defining an alternative timeout in seconds within the ManagerBase, which would only be used by unit tests. ManagerBase would use its own timeout if non-zero, otherwise use the Context value in minutes. I would really appreciate some guidance on the best way to proceed. (Perhaps it is better to keep things simple by living with an 80 seconds test time?) > >> >>> Best regards, >>> Konstantin Kolinko >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org >>> For additional commands, e-mail: dev-help@tomcat.apache.org >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: dev-help@tomcat.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org > For additional commands, e-mail: dev-help@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org