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

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


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

commit 88ba128ff4d7f7e4ecfd38f94b56c775d96645fc
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 1e9d2359ec..5fae44a46c 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