adoroszlai commented on code in PR #7285:
URL: https://github.com/apache/ozone/pull/7285#discussion_r1792897587
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/OzoneRpcClientTests.java:
##########
@@ -3140,6 +3149,34 @@ void testMultipartUploadOverride(ReplicationConfig
replication)
doMultipartUpload(bucket, keyName, (byte)97, replication);
}
+
+ @Test
+ public void testClientLeakDetector() throws Exception {
+ HddsUtils.setIgnoreReportingLeak(true);
+ OzoneClient client = OzoneClientFactory.getRpcClient(cluster.getConf());
+ String volumeName = UUID.randomUUID().toString();
+ String bucketName = UUID.randomUUID().toString();
+ String keyName = UUID.randomUUID().toString();
+ GenericTestUtils.LogCapturer ozoneClientFactoryLogCapturer =
+ GenericTestUtils.LogCapturer.captureLogs(
+ OzoneClientFactory.getLogger());
+
+ client.getObjectStore().createVolume(volumeName);
+ OzoneVolume volume = client.getObjectStore().getVolume(volumeName);
+ volume.createBucket(bucketName);
+ OzoneBucket bucket = volume.getBucket(bucketName);
+ byte[] data = new byte[10];
+ Arrays.fill(data, (byte) 1);
+ try (OzoneOutputStream out = bucket.createKey(keyName, 10,
+ ReplicationConfig.fromTypeAndFactor(RATIS, ONE), new HashMap<>())) {
+ out.write(data);
+ }
+ client = null;
+ System.gc();
+ GenericTestUtils.waitFor(() -> ozoneClientFactoryLogCapturer.getOutput()
+ .contains("is not closed correctly"), 100, 2000);
+ HddsUtils.setIgnoreReportingLeak(false);
Review Comment:
You are right.
`TestRocksObjectLeakDetector` is disabled in CI for the same reason:
https://github.com/apache/ozone/blob/e00f7ae960ef2c5a5efc8a439e38f5931d8be383/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestRocksObjectLeakDetector.java#L37-L44
We can keep the flag + test-specific message, or disable this test case, too.
--
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]