You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/05/22 10:57:25 UTC
svn commit: r1596779 -
/tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java
Author: markt
Date: Thu May 22 08:57:24 2014
New Revision: 1596779
URL: http://svn.apache.org/r1596779
Log:
Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=56546
Avoid stack trace with org.apache.catalina.connector.TestMaxConnections
Ensure request processing has finished by increasing unload delay to allow request that was waiting in the accept queue to be processed before shutdown completes.
Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java
Modified: tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java?rev=1596779&r1=1596778&r2=1596779&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java Thu May 22 08:57:24 2014
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRes
import org.junit.Assert;
import org.junit.Test;
-import org.apache.catalina.Context;
+import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.SimpleHttpClient;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.startup.TomcatBaseTest;
@@ -70,7 +70,8 @@ public class TestMaxConnections extends
private synchronized void init() throws Exception {
Tomcat tomcat = getTomcatInstance();
- Context root = tomcat.addContext("", SimpleHttpClient.TEMP_DIR);
+ StandardContext root = (StandardContext) tomcat.addContext("", SimpleHttpClient.TEMP_DIR);
+ root.setUnloadDelay(soTimeout);
Tomcat.addServlet(root, "Simple", new SimpleServlet());
root.addServletMapping("/test", "Simple");
tomcat.getConnector().setProperty("maxKeepAliveRequests", "1");
@@ -128,9 +129,10 @@ public class TestMaxConnections extends
increment();
+ System.out.println("Processing thread: " + Thread.currentThread().getName());
try {
Thread.sleep(TestMaxConnections.soTimeout*4/5);
- }catch (InterruptedException x) {
+ } catch (InterruptedException x) {
}
resp.setContentLength(0);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org