This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 5d46443abcdf283c073247b22ca2cf6ce58cd697 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Mar 24 19:03:10 2021 +0000 Enable debug logging for a test that is failing intermittently in CI --- .../apache/catalina/core/TestAsyncContextImpl.java | 39 +++++++++++++--------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java b/test/org/apache/catalina/core/TestAsyncContextImpl.java index e1672d3..b7de45d 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImpl.java +++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java @@ -28,6 +28,8 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; +import java.util.logging.LogManager; import javax.servlet.AsyncContext; import javax.servlet.AsyncEvent; @@ -2739,29 +2741,34 @@ public class TestAsyncContextImpl extends TomcatBaseTest { private void doTestAsyncIoEnd(boolean useThread, boolean useComplete) throws Exception { - Tomcat tomcat = getTomcatInstance(); + LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.ALL); + try { + Tomcat tomcat = getTomcatInstance(); - // No file system docBase required - Context ctx = tomcat.addContext("", null); + // No file system docBase required + Context ctx = tomcat.addContext("", null); - AsyncIoEndServlet asyncIoEndServlet = new AsyncIoEndServlet(useThread, useComplete); - Wrapper wrapper = Tomcat.addServlet(ctx, "asyncIoEndServlet", asyncIoEndServlet); - wrapper.setAsyncSupported(true); - ctx.addServletMappingDecoded("/asyncIoEndServlet", "asyncIoEndServlet"); + AsyncIoEndServlet asyncIoEndServlet = new AsyncIoEndServlet(useThread, useComplete); + Wrapper wrapper = Tomcat.addServlet(ctx, "asyncIoEndServlet", asyncIoEndServlet); + wrapper.setAsyncSupported(true); + ctx.addServletMappingDecoded("/asyncIoEndServlet", "asyncIoEndServlet"); - SimpleServlet simpleServlet = new SimpleServlet(); - Tomcat.addServlet(ctx, "simpleServlet", simpleServlet); - ctx.addServletMappingDecoded("/simpleServlet", "simpleServlet"); + SimpleServlet simpleServlet = new SimpleServlet(); + Tomcat.addServlet(ctx, "simpleServlet", simpleServlet); + ctx.addServletMappingDecoded("/simpleServlet", "simpleServlet"); - tomcat.start(); + tomcat.start(); - ByteChunk body = new ByteChunk(); - int rc = getUrl("http://localhost:" + getPort() + "/asyncIoEndServlet", body, null); + ByteChunk body = new ByteChunk(); + int rc = getUrl("http://localhost:" + getPort() + "/asyncIoEndServlet", body, null); - Assert.assertEquals(HttpServletResponse.SC_OK, rc); - Assert.assertEquals("OK", body.toString()); + Assert.assertEquals(HttpServletResponse.SC_OK, rc); + Assert.assertEquals("OK", body.toString()); - Assert.assertFalse(asyncIoEndServlet.getInvalidStateDetected()); + Assert.assertFalse(asyncIoEndServlet.getInvalidStateDetected()); + } finally { + LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.INFO); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org