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

dakirily pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/main by this push:
     new dd3fda0eb0 QPID-8753: [Broker-J] NonBlockingConnectionCloseTest - 
check connection close buffers against the test baseline (#477)
dd3fda0eb0 is described below

commit dd3fda0eb0801b72123a4db66f1d8414ecb0c48c
Author: Daniil Kirilyuk <[email protected]>
AuthorDate: Mon Nov 16 15:23:46 2026 +0100

    QPID-8753: [Broker-J] NonBlockingConnectionCloseTest - check connection 
close buffers against the test baseline (#477)
---
 .../qpid/server/transport/NonBlockingConnectionCloseTest.java      | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/broker-core/src/test/java/org/apache/qpid/server/transport/NonBlockingConnectionCloseTest.java
 
b/broker-core/src/test/java/org/apache/qpid/server/transport/NonBlockingConnectionCloseTest.java
index a753abb6c8..9e5ef8f16e 100644
--- 
a/broker-core/src/test/java/org/apache/qpid/server/transport/NonBlockingConnectionCloseTest.java
+++ 
b/broker-core/src/test/java/org/apache/qpid/server/transport/NonBlockingConnectionCloseTest.java
@@ -79,6 +79,7 @@ class NonBlockingConnectionCloseTest extends UnitTestBase
     private AmqpPort<?> _port;
     private SSLEngine _sslEngine;
     private NonBlockingConnection _connection;
+    private int _buffersInUseBeforeTest;
 
     @BeforeEach
     void setUp() throws Exception
@@ -89,6 +90,7 @@ class NonBlockingConnectionCloseTest extends UnitTestBase
         _sslEngine = null;
         QpidByteBuffer.deinitialisePool();
         QpidByteBuffer.initialisePool(BUFFER_SIZE, 16, 0.5);
+        _buffersInUseBeforeTest = QpidByteBuffer.getNumberOfBuffersInUse();
         _socket = createSocketChannel(_writable::get);
         _engine = mock(ProtocolEngine.class);
         when(_engine.getAggregateTicker()).thenReturn(_ticker);
@@ -683,7 +685,8 @@ class NonBlockingConnectionCloseTest extends UnitTestBase
         verify(_socket).close();
         verify(_engine).closed();
         verify(_scheduler).removeConnection(_connection);
-        assertEquals(0, QpidByteBuffer.getNumberOfBuffersInUse(), "Shutdown 
must release buffers");
+        assertEquals(_buffersInUseBeforeTest, 
QpidByteBuffer.getNumberOfBuffersInUse(),
+                "Shutdown must release buffers allocated by this test");
     }
 
     private void createConnection(final TransportEncryption encryption) throws 
Exception
@@ -743,7 +746,7 @@ class NonBlockingConnectionCloseTest extends UnitTestBase
         assertFalse(_connection.doWork());
         assertTrue(_connection.wantsWrite() || _connection.wantsRead(),
                 "Blocked output must wait for socket capacity or TLS peer 
input");
-        assertTrue(QpidByteBuffer.getNumberOfBuffersInUse() > 0);
+        assertTrue(QpidByteBuffer.getNumberOfBuffersInUse() > 
_buffersInUseBeforeTest);
     }
 
     private void queueOutput()


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

Reply via email to