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

    https://github.com/apache/zookeeper/pull/549#discussion_r198607891
  
    --- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java ---
    @@ -103,6 +103,23 @@ public void testCustomSSLAuth()
             }
         }
     
    +    /**
    +     * Test case for https://issues.apache.org/jira/browse/ZOOKEEPER-2873
    +     */
    +    @Test
    +    public void testSamePortConfiguredForClientAndElection() throws 
IOException, ConfigException {
    +        QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig();
    +        try {
    +            Properties zkProp = getDefaultZKProperties();
    +            zkProp.setProperty("server.1", "localhost:2888:2888");
    +            quorumPeerConfig.parseProperties(zkProp);
    +            fail("ConfigException is expected");
    +        } catch (ConfigException ce) {
    --- End diff --
    
    I agree that your test as written is more exact, my proposal is more about 
future proofing the test so it doesn't get hung up on the exact language of the 
exception thrown.
    
    I will happily defer the point to someone with more ZooKeeper experience 
about which is more in the project's style.


---

Reply via email to