Copilot commented on code in PR #11007:
URL: https://github.com/apache/ozone/pull/11007#discussion_r3769911830


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptions.java:
##########
@@ -201,7 +201,7 @@ void testMaxRetriesByOzoneClient() throws Exception {
                 .getPipeline(container.getPipelineID());
         XceiverClientSpi xceiverClient =
             xceiverClientManager.acquireClient(pipeline);
-        assertThat(containerList.contains(containerID));
+        Assumptions.assumeFalse(containerList.contains(containerID));
         containerList.add(containerID);
         xceiverClient.sendCommand(ContainerTestHelper

Review Comment:
   `Assumptions.assumeFalse(...)` can abort the test by throwing 
`TestAbortedException`. Since it is executed *after* `acquireClient(pipeline)`, 
the `xceiverClient` may never be released, which can leak clients/resources and 
potentially affect subsequent tests in the same JVM.
   
   Move the assumption check before acquiring the client (or wrap the 
send/release in a `try/finally`) so the client is always released.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to