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

davsclaus pushed a commit to branch CAMEL-27568-netty-flaky-test
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 21d9173f914361e5ffe5ac76fc02b9714f4986a0
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 26 11:56:46 2026 +0100

    CAMEL-27568: camel-netty - Fix flaky test NettyProducerStrayExceptionTest
    
    With requestTimeout=1000 the read timeout closed the unused channel when the
    greeting of the test server came later than one second, as on a busy CI
    machine. The test now takes the read timeout off the unused channel; the 
pool
    adds a new one when the request borrows the channel.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../camel/component/netty/NettyProducerStrayExceptionTest.java       | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyProducerStrayExceptionTest.java
 
b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyProducerStrayExceptionTest.java
index e44d1dee29dc..a25539830829 100644
--- 
a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyProducerStrayExceptionTest.java
+++ 
b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyProducerStrayExceptionTest.java
@@ -127,6 +127,11 @@ class NettyProducerStrayExceptionTest extends 
CamelTestSupport {
 
     private void startProducerAndAwaitException(String options) throws 
Exception {
         Channel channel = startProducer(options);
+        // without a request the read timeout would close the unused channel 
before a slow greeting arrives; the pool
+        // adds a new one when the request borrows the channel (activateObject)
+        if (channel.pipeline().get("timeout") != null) {
+            channel.pipeline().remove("timeout");
+        }
         // see the exception before the producer's handler gets it, and count 
down once that handler is done with it
         channel.pipeline().addBefore("handler", "exceptionProbe", new 
ChannelInboundHandlerAdapter() {
             @Override

Reply via email to