rahulrane50 commented on code in PR #2219:
URL: https://github.com/apache/helix/pull/2219#discussion_r975916486
##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestRawZkClient.java:
##########
@@ -1063,23 +1063,29 @@ public void testAsyncWriteByExpectedSession() throws
Exception {
* Tests getChildren() when there are an excessive number of children and
connection loss happens,
* the operation should terminate and exit retry loop.
*/
- @Test(timeOut = 30 * 1000L)
+ @Test
public void testGetChildrenOnLargeNumChildren() throws Exception {
final String methodName = TestHelper.getTestMethodName();
System.out.println("Start test: " + methodName);
// Create 110K children to make packet length of children exceed 4 MB
// and cause connection loss for getChildren() operation
String path = "/" + methodName;
+ int numOps = 110;
+ int numOpInOps = 1000;
+ // All the paths that are going to be created as children nodes, plus one
parent node
+ // Record paths so can be deleted at the end of the test
+ String[] nodePaths = new String[numOps * numOpInOps + 1];
+ nodePaths[numOps * numOpInOps] = path;
_zkClient.createPersistent(path);
- for (int i = 0; i < 110; i++) {
- List<Op> ops = new ArrayList<>(1000);
- for (int j = 0; j < 1000; j++) {
+ for (int i = 0; i < numOps; i++) {
+ List<Op> ops = new ArrayList<>(numOpInOps);
+ for (int j = 0; j < numOpInOps; j++) {
String childPath = path + "/" + UUID.randomUUID().toString();
- // Create ephemeral nodes so closing zkClient deletes them for cleanup
+ nodePaths[numOpInOps * i + j] = childPath;
ops.add(
- Op.create(childPath, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
CreateMode.EPHEMERAL));
+ Op.create(childPath, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT));
Review Comment:
Ah i got your point now, thanks a lot for explaining!
--
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]