GuoPhilipse commented on a change in pull request #3684:
URL: https://github.com/apache/hadoop/pull/3684#discussion_r762411630



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImage.java
##########
@@ -275,6 +276,29 @@ public void testSaveAndLoadStripedINodeFile() throws 
IOException{
     }
   }
 
+  @Test
+  public void testImportCheckpoint() {
+    Configuration conf = new Configuration();
+    conf.set(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_EDITS_DIR_KEY, "");
+    MiniDFSCluster cluster = null;
+    try {
+      cluster = new MiniDFSCluster.Builder(conf).build();
+      cluster.waitActive();
+      FSNamesystem fsn = cluster.getNamesystem();
+      FSImage fsImage= new FSImage(conf);
+      fsImage.doImportCheckpoint(fsn);
+      fail("Expect to throw IOException.");
+    } catch (IOException e) {
+      GenericTestUtils.assertExceptionContains(
+              "Cannot import image from a checkpoint. "
+                      + "\"dfs.namenode.checkpoint.edits.dir\" is not set.", 
e);

Review comment:
       Thanks @ayushtkn for your advice, just updated.




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to