zaynt4606 commented on code in PR #2701:
URL: https://github.com/apache/celeborn/pull/2701#discussion_r1767192193
##########
master/src/test/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/RatisMasterStatusSystemSuiteJ.java:
##########
@@ -844,6 +844,93 @@ public void testHandleUnRegisterShuffle() throws
InterruptedException {
Assert.assertTrue(STATUSSYSTEM3.registeredShuffle.isEmpty());
}
+ @Test
+ public void testBatchHandleUnRegisterShuffle() throws InterruptedException {
+ AbstractMetaManager statusSystem = pickLeaderStatusSystem();
+ Assert.assertNotNull(statusSystem);
+
+ statusSystem.handleRegisterWorker(
+ HOSTNAME1,
+ RPCPORT1,
+ PUSHPORT1,
+ FETCHPORT1,
+ REPLICATEPORT1,
+ INTERNALPORT1,
+ NETWORK_LOCATION1,
+ disks1,
+ userResourceConsumption1,
+ getNewReqeustId());
+ statusSystem.handleRegisterWorker(
+ HOSTNAME2,
+ RPCPORT2,
+ PUSHPORT2,
+ FETCHPORT2,
+ REPLICATEPORT2,
+ INTERNALPORT2,
+ NETWORK_LOCATION2,
+ disks2,
+ userResourceConsumption2,
+ getNewReqeustId());
+ statusSystem.handleRegisterWorker(
+ HOSTNAME3,
+ RPCPORT3,
+ PUSHPORT3,
+ FETCHPORT3,
+ REPLICATEPORT3,
+ INTERNALPORT3,
+ NETWORK_LOCATION3,
+ disks3,
+ userResourceConsumption3,
+ getNewReqeustId());
+
+ WorkerInfo workerInfo1 =
+ new WorkerInfo(
+ HOSTNAME1,
+ RPCPORT1,
+ PUSHPORT1,
+ FETCHPORT1,
+ REPLICATEPORT1,
+ INTERNALPORT1,
+ disks1,
+ userResourceConsumption1);
+ WorkerInfo workerInfo2 =
+ new WorkerInfo(
+ HOSTNAME2,
+ RPCPORT2,
+ PUSHPORT2,
+ FETCHPORT2,
+ REPLICATEPORT2,
+ INTERNALPORT2,
+ disks2,
+ userResourceConsumption2);
+
+ Map<String, Map<String, Integer>> workersToAllocate = new HashMap<>();
+ Map<String, Integer> allocations = new HashMap<>();
+ allocations.put("disk1", 5);
+ workersToAllocate.put(workerInfo1.toUniqueId(), allocations);
+ workersToAllocate.put(workerInfo2.toUniqueId(), allocations);
+
+ List<String> shuffleKeys = new ArrayList<>();
+ for (int i = 1; i <= 3; i++) {
+ String shuffleKey = APPID1 + "-" + i;
+ shuffleKeys.add(shuffleKey);
+ statusSystem.handleRequestSlots(shuffleKey, HOSTNAME1,
workersToAllocate, getNewReqeustId());
+ }
+
+ Thread.sleep(3000L);
+
+ Assert.assertEquals(3, STATUSSYSTEM1.registeredShuffle.size());
+ Assert.assertEquals(3, STATUSSYSTEM2.registeredShuffle.size());
+ Assert.assertEquals(3, STATUSSYSTEM3.registeredShuffle.size());
+
+ statusSystem.batchHandleUnRegisterShuffles(shuffleKeys, getNewReqeustId());
Review Comment:
Added these two tests in the ha mode and single mode TestSuite~
--
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]