shvachko commented on a change in pull request #2260:
URL: https://github.com/apache/hadoop/pull/2260#discussion_r644407043
##########
File path:
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemBaseTest.java
##########
@@ -1428,4 +1430,45 @@ public void testGetContentSummaryWithFileInLocalFS()
throws Exception {
summaryAfter.getLength());
}
}
+
+ @Test
+ public void testTargetFileSystemLazyInitialization() throws Exception {
+ final String clusterName = "cluster" + new Random().nextInt();
+ Configuration config = new Configuration(conf);
+ config.setBoolean(CONFIG_VIEWFS_ENABLE_INNER_CACHE, false);
+ config.setClass("fs.mockfs.impl",
+ TestChRootedFileSystem.MockFileSystem.class, FileSystem.class);
+ ConfigUtil.addLink(config, clusterName, "/user",
+ URI.create("mockfs://mockauth1/mockpath"));
+ ConfigUtil.addLink(config, clusterName,
+ "/mock", URI.create("mockfs://mockauth/mockpath"));
+
+ final int cacheSize = TestFileUtil.getCacheSize();
Review comment:
You can call `closeAll()` here, which clears the cache completely. And
the you can compare with 0 in the assert.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]