zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgs1 <...@git.apache.org>
Subject [GitHub] zookeeper pull request #98: ZOOKEEPER-2479
Date Fri, 18 Nov 2016 05:50:06 GMT
Github user rgs1 commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/98#discussion_r88602850
  
    --- Diff: src/java/test/org/apache/zookeeper/test/QuorumMajorityTest.java ---
    @@ -36,7 +38,30 @@
         /***************************************************************/
         @Test
         public void testMajQuorums() throws Throwable {
    -       
    +        LOG.info("Verify QuorumPeer#electionTimeTaken jmx bean attribute");
    +
    +        ArrayList<QuorumPeer> peers = getPeerList();
    +        for (int i = 1; i <= peers.size(); i++) {
    +            QuorumPeer qp = peers.get(i - 1);
    +            Long electionTimeTaken = -1L;
    +            String bean = "";
    +            if (qp.getPeerState() == ServerState.FOLLOWING) {
    +                bean = CommonNames.DOMAIN + ":name0=ReplicatedServer_id" + i
    +                        + ",name1=replica." + i + ",name2=Follower";
    +                electionTimeTaken = (Long) JMXEnv.ensureBeanAttribute(bean,
    +                        "ElectionTimeTaken");
    +                Assert.assertTrue("Wrong electionTimeTaken value!",
    +                        electionTimeTaken >= 0);
    +            } else if (qp.getPeerState() == ServerState.LEADING) {
    +                bean = CommonNames.DOMAIN + ":name0=ReplicatedServer_id" + i
    +                        + ",name1=replica." + i + ",name2=Leader";
    --- End diff --
    
    ditto


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message