ZkTestHelper.expireSession(participantToExpire.getZkClient());
String newSessionId = participantToExpire.getSessionId();
System.out.println("oldSessionId: " + oldSessionId + ", newSessionId: " + newSessionId);
Assert.assertTrue(newSessionId.compareTo(oldSessionId) > 0, "Session id should be increased after expiry");
ClusterSetup setupTool = new ClusterSetup(ZK_ADDR);
setupTool.addResourceToCluster(clusterName, "TestDB1", 10, "MasterSlave");
setupTool.rebalanceStorageCluster(clusterName, "TestDB1", 3);
result =
ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR,
clusterName));
Assert.assertTrue(result);
// controller session expiry
System.out.println("Expire controller session");
oldSessionId = controller.getSessionId();
ZkTestHelper.expireSession(controller.getZkClient());
newSessionId = controller.getSessionId();
System.out.println("oldSessionId: " + oldSessionId + ", newSessionId: " + newSessionId);
Assert.assertTrue(newSessionId.compareTo(oldSessionId) > 0, "Session id should be increased after expiry");
setupTool.addResourceToCluster(clusterName, "TestDB2", 8, "MasterSlave");
setupTool.rebalanceStorageCluster(clusterName, "TestDB2", 3);
result =
ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR,
clusterName));
Assert.assertTrue(result);