xyuanlu commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r960029720
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,29 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new
Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+ _gZkClient.deleteRecursively("/" + root);
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new
ZkBaseDataAccessor<>(_gZkClient);
+
+ // CreateChildren
+ List<ZNRecord> records = new ArrayList<>();
+ List<String> paths = new ArrayList<>();
+ for (int i = 0; i < 10; i++) {
+ String msgId = "msg_" + i;
+ paths.add(PropertyPathBuilder.instanceMessage(root, "host_1", msgId));
+ records.add(new ZNRecord(msgId));
+ }
+ boolean[] success = accessor.createChildren(paths, records,
AccessOption.PERSISTENT);
+
+ // Attempt to remove parent. Shouldn't throw an error or warning log.
+ // Should return True if recursive deletion succeeds.
+
Assert.assertTrue(accessor.remove(PropertyPathBuilder.instanceMessage(root,
"host_1"), 0),
+ "Should return True despite log errors.");
+ }
+
Review Comment:
Thanks for making this change!!
I would suggest validate that these ZNode has already being deleted.
--
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]