This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 334fe96ec0 Enable the NIO2 channel pool explicitly in the channel 
recycle tests
334fe96ec0 is described below

commit 334fe96ec0a38125d7fddefc949264fa24a4ba59
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Dec 2 22:38:35 2026 +0000

    Enable the NIO2 channel pool explicitly in the channel recycle tests
    
    The pool is disabled by default when the maximum heap is 2GB or less so the
    tests failed with an NPE on systems with a small heap.
    
    Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
---
 test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java         | 2 ++
 test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java 
b/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java
index 32f4d46dc4..8bd26807cd 100644
--- a/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java
+++ b/test/org/apache/tomcat/util/net/TestNio2ChannelRecycle.java
@@ -45,6 +45,8 @@ public class TestNio2ChannelRecycle extends TomcatBaseTest {
     public void startConnector() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         Assume.assumeTrue("NIO2 only", 
tomcat.getConnector().getProtocolHandler() instanceof Http11Nio2Protocol);
+        // The pool is disabled by default if the heap is small so enable it 
explicitly
+        
Assert.assertTrue(tomcat.getConnector().setProperty("socket.bufferPool", 
"100"));
         tomcat.start();
 
         Method getEndpoint = 
AbstractProtocol.class.getDeclaredMethod("getEndpoint");
diff --git 
a/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java 
b/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java
index a1099ef79b..c741d45ec1 100644
--- a/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java
+++ b/test/org/apache/tomcat/util/net/TestNio2SendfileChannelRecycle.java
@@ -64,6 +64,8 @@ public class TestNio2SendfileChannelRecycle extends 
TomcatBaseTest {
         Context ctx = getProgrammaticRootContext();
         Tomcat.addServlet(ctx, "sendfile", new SendfileServlet(file));
         ctx.addServletMappingDecoded("/sendfile", "sendfile");
+        // The pool is disabled by default if the heap is small so enable it 
explicitly
+        
Assert.assertTrue(tomcat.getConnector().setProperty("socket.bufferPool", 
"100"));
         tomcat.start();
 
         Method getEndpoint = 
AbstractProtocol.class.getDeclaredMethod("getEndpoint");


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to