aswinshakil commented on code in PR #5605:
URL: https://github.com/apache/ozone/pull/5605#discussion_r1394819564
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotFileSystem.java:
##########
@@ -655,7 +698,6 @@ public void testListStatusOnRoot() throws Exception {
// based on TestOzoneFileSystem:testListStatusOnLargeDirectory
public void testListStatusOnLargeDirectory() throws Exception {
Path root = new Path("/");
- deleteRootDir(); // cleanup
Review Comment:
Do we not need the cleanup anymore? I believe this is to clean up from the
previous test run right?
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotFileSystem.java:
##########
@@ -291,27 +269,46 @@ public void testListKeysAtDifferentLevels() throws
Exception {
checkKeyList(ozoneKeyIterator, expectedKeys);
// Intermediate level keyPrefix - 3rd level
- ozoneKeyIterator =
- ozoneBucket.listKeys(keyPrefix + "a/b2/d1", null);
+ ozoneKeyIterator = ozoneBucket.listKeys(keyPrefix + "a/b2/d1", null);
expectedKeys = new LinkedList<>();
expectedKeys.add("a/b2/d1/");
expectedKeys.add("a/b2/d1/d11.tx");
checkKeyList(ozoneKeyIterator, expectedKeys);
// Boundary of a level
- ozoneKeyIterator =
- ozoneBucket.listKeys(keyPrefix + "a/b2/d2",
- keyPrefix + "a/b2/d2/d21.tx");
+ ozoneKeyIterator = ozoneBucket.listKeys(keyPrefix + "a/b2/d2",
+ keyPrefix + "a/b2/d2/d21.tx");
expectedKeys = new LinkedList<>();
expectedKeys.add("a/b2/d2/d22.tx");
checkKeyList(ozoneKeyIterator, expectedKeys);
// Boundary case - last node in the depth-first-traversal
- ozoneKeyIterator =
- ozoneBucket.listKeys(keyPrefix + "a/b3/e3",
- keyPrefix + "a/b3/e3/e31.tx");
+ ozoneKeyIterator = ozoneBucket.listKeys(keyPrefix + "a/b3/e3",
+ keyPrefix + "a/b3/e3/e31.tx");
expectedKeys = new LinkedList<>();
checkKeyList(ozoneKeyIterator, expectedKeys);
+
+ deleteSnapshot(snapshotName);
+ String expectedMessage = String.format("Unable to load snapshot. " +
+ "Snapshot with table key '/%s/%s/%s' is no longer active",
+ volumeName, bucketName, snapshotName);
+ OMException exception = assertThrows(OMException.class,
+ () -> ozoneBucket.listKeys(keyPrefix + "a/", null));
+ assertEquals(expectedMessage, exception.getMessage());
+ exception = assertThrows(OMException.class,
+ () -> ozoneBucket.listKeys(keyPrefix + "a///b2///", null));
Review Comment:
Should this be just "a/b2/"?
--
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]