bshashikant commented on a change in pull request #2181: URL: https://github.com/apache/hadoop/pull/2181#discussion_r463654642
########## File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/snapshot/TestListSnapshot.java ########## @@ -128,7 +132,15 @@ public void testListSnapshot() throws Exception { snapshotStatuses[2].getFullPath()); hdfs.deleteSnapshot(dir1, "s2"); snapshotStatuses = hdfs.getSnapshotListing(dir1); - // There are now 2 snapshots for dir1 + // There are now 2 active snapshots for dir1 and one is marked deleted + assertEquals(3, snapshotStatuses.length); + assertTrue(snapshotStatuses[2].isDeleted()); + assertFalse(snapshotStatuses[1].isDeleted()); + assertFalse(snapshotStatuses[0].isDeleted()); + // delete the 1st snapshot + hdfs.deleteSnapshot(dir1, "s0"); + snapshotStatuses = hdfs.getSnapshotListing(dir1); + // There are now 2 snapshots now as the 1st one is deleted in order Review comment: S0 is the first snapshot in the list. It won't be marked deleted. The next assertion is hence to check whether snapshot size has reduced or not. ---------------------------------------------------------------- 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: 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