gemmellr commented on code in PR #4545:
URL: https://github.com/apache/activemq-artemis/pull/4545#discussion_r1261040741
##########
artemis-quorum-ri/src/test/java/org/apache/activemq/artemis/quorum/zookeeper/CuratorDistributedLockTest.java:
##########
@@ -337,21 +333,8 @@ public void
beNotifiedOfAlreadyUnavailableManagerAfterAddingListener() throws Ex
}
}
- private boolean ensembleHasLeader() {
- return
testingServer.getServers().stream().filter(CuratorDistributedLockTest::isLeader).count()
!= 0;
- }
-
- private static boolean isLeader(TestingZooKeeperServer server) {
- if (server.getInstanceSpecs().size() == 1) {
- return true;
- }
- long leaderId = server.getQuorumPeer().getLeaderId();
- long id = server.getQuorumPeer().getId();
- return id == leaderId;
- }
-
private void stopMajorityNotLeaderNodes(boolean fromLast) throws Exception {
- List<TestingZooKeeperServer> followers =
testingServer.getServers().stream().filter(Predicates.not(CuratorDistributedLockTest::isLeader)).collect(Collectors.toList());
+ List<TestingZooKeeperServer> followers = testingServer.getServers();
Review Comment:
I was not really pointing out the name wasnt descriptive, but that you
appeared to have changed _what the method is trying to do_. As that could be a
difference that alters expected behaviour for tests using it, it isnt
immediately obvious as being desirable.
--
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]