steveloughran commented on code in PR #6488:
URL: https://github.com/apache/hadoop/pull/6488#discussion_r1474327653
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java:
##########
@@ -526,6 +526,18 @@ public void testRenameDirectoryMoveToExistingDirectory()
throws Exception {
fs.exists(path(dst + "/subdir/file2")));
}
+ @Test
+ public void testStatisticsDataReferenceCleanerClassLoader() {
+ // initialize the static thread
+ new FileSystem.Statistics("test");
+ Thread.getAllStackTraces().keySet().stream()
+ .filter(t ->
t.getName().contains("StatisticsDataReferenceCleaner")).findFirst()
+ .ifPresent(t -> {
+ ClassLoader classLoader = t.getContextClassLoader();
+ assertNull(classLoader);
+ });
Review Comment:
nice.
Can you put it in `TestFileSystemStorageStatistics` as I think it is a
better home. Putting it in this test suite will actually rerun it multiple
times: once per subclass
--
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]