Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/476#discussion_r171970721
  
    --- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
    @@ -1012,4 +1012,113 @@ public void testFailedTxnAsPartOfQuorumLoss() 
throws Exception {
                 Assert.assertNull("server " + i + " should not have /zk" + 
leader, servers.zk[i].exists("/zk" + leader, false));
             }
         }
    +
    +    /**
    +     * Verify that a node without the leader in its view will not attempt 
to connect to the leader.
    +     */
    +    @Test
    +    public void testLeaderOutOfView() throws Exception {
    +        ClientBase.setupTestEnv();
    +
    +        Layout layout = new PatternLayout("%d{ISO8601} [,yid:%X{myid}] - 
%5p [%t:%C{1}@%L] - %m%n");
    --- End diff --
    
    It would be great if we did not specify the pattern as a literal. Take a 
look at some of the other tests and see if the way they get the patternlayout 
could apply here (`testElectionFraud` for example).


---

Reply via email to