You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by rakeshadr <gi...@git.apache.org> on 2016/12/21 15:29:02 UTC

[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

GitHub user rakeshadr opened a pull request:

    https://github.com/apache/zookeeper/pull/131

    ZOOKEEPER-2650: Test Improvement by adding more QuorumPeer Auth relat\u2026

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rakeshadr/zookeeper-1 ZK-2650

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zookeeper/pull/131.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #131
    
----
commit 46b438e968300c61b10f7e8966fccbde85f84637
Author: Rakesh Radhakrishnan <ra...@apache.org>
Date:   2016-12-21T15:24:55Z

    ZOOKEEPER-2650: Test Improvement by adding more QuorumPeer Auth related test cases

----


---
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.
---

[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

Posted by rakeshadr <gi...@git.apache.org>.
Github user rakeshadr commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/131#discussion_r93579253
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java ---
    @@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
             return connectStr.toString();
         }
     
    -    protected int[] startQuorum(final int serverCount, StringBuilder connectStr,
    -            Map<String, String> authConfigs, int authServerCount) throws IOException {
    +    /**
    +     * Starts the given number of quorum servers and will wait for the quorum
    +     * formation.
    +     *
    +     * @param serverCount
    +     *            total server count includes participants + observers
    +     * @param ObserverCount
    +     *            number of observers
    +     * @param authConfigs
    +     *            configuration parameters for authentication
    +     * @param authServerCount
    +     *            number of auth enabled servers
    +     * @return client port for the respective servers
    +     * @throws IOException
    +     */
    +    protected String startQuorum(final int serverCount, int ObserverCount,
    --- End diff --
    
    Changed to "observerCount"


---
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.
---

[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

Posted by rakeshadr <gi...@git.apache.org>.
Github user rakeshadr closed the pull request at:

    https://github.com/apache/zookeeper/pull/131


---
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.
---

[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

Posted by rgs1 <gi...@git.apache.org>.
Github user rgs1 commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/131#discussion_r93572633
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java ---
    @@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
             return connectStr.toString();
         }
     
    -    protected int[] startQuorum(final int serverCount, StringBuilder connectStr,
    -            Map<String, String> authConfigs, int authServerCount) throws IOException {
    +    /**
    +     * Starts the given number of quorum servers and will wait for the quorum
    +     * formation.
    +     *
    +     * @param serverCount
    +     *            total server count includes participants + observers
    +     * @param ObserverCount
    +     *            number of observers
    +     * @param authConfigs
    +     *            configuration parameters for authentication
    +     * @param authServerCount
    +     *            number of auth enabled servers
    +     * @return client port for the respective servers
    +     * @throws IOException
    +     */
    +    protected String startQuorum(final int serverCount, int ObserverCount,
    --- End diff --
    
    why is ObserverCount uppercased and also why is not used?


---
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.
---

[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

Posted by rakeshadr <gi...@git.apache.org>.
Github user rakeshadr commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/131#discussion_r93579277
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java ---
    @@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
             return connectStr.toString();
         }
     
    -    protected int[] startQuorum(final int serverCount, StringBuilder connectStr,
    -            Map<String, String> authConfigs, int authServerCount) throws IOException {
    +    /**
    +     * Starts the given number of quorum servers and will wait for the quorum
    +     * formation.
    +     *
    +     * @param serverCount
    +     *            total server count includes participants + observers
    +     * @param ObserverCount
    +     *            number of observers
    +     * @param authConfigs
    +     *            configuration parameters for authentication
    +     * @param authServerCount
    +     *            number of auth enabled servers
    +     * @return client port for the respective servers
    +     * @throws IOException
    +     */
    +    protected String startQuorum(final int serverCount, int ObserverCount,
    +            Map<String, String> authConfigs, int authServerCount)
    +                    throws IOException {
    +        StringBuilder connectStr = new StringBuilder();
    +        final int[] clientPorts = startQuorum(serverCount, 0, connectStr,
    +                authConfigs, authServerCount);
    +        for (int i = 0; i < serverCount; i++) {
    +            Assert.assertTrue("waiting for server " + i + " being up",
    +                    ClientBase.waitForServerUp("127.0.0.1:" + clientPorts[i],
    +                            ClientBase.CONNECTION_TIMEOUT));
    +        }
    +        return connectStr.toString();
    +    }
    +
    +    /**
    +     * Starts the given number of quorum servers and won't wait for the quorum
    +     * formation.
    +     *
    +     * @param serverCount
    +     *            total server count includes participants + observers
    +     * @param ObserverCount
    +     *            number of observers
    +     * @param connectStr
    +     *            connection string where clients can used for connection
    +     *            establishment
    +     * @param authConfigs
    +     *            configuration parameters for authentication
    +     * @param authServerCount
    +     *            number of auth enabled servers
    +     * @return client port for the respective servers
    +     * @throws IOException
    +     */
    +    protected int[] startQuorum(final int serverCount, int ObserverCount,
    --- End diff --
    
    Done


---
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.
---

[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

Posted by rgs1 <gi...@git.apache.org>.
Github user rgs1 commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/131#discussion_r93572708
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java ---
    @@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
             return connectStr.toString();
         }
     
    -    protected int[] startQuorum(final int serverCount, StringBuilder connectStr,
    -            Map<String, String> authConfigs, int authServerCount) throws IOException {
    +    /**
    +     * Starts the given number of quorum servers and will wait for the quorum
    +     * formation.
    +     *
    +     * @param serverCount
    +     *            total server count includes participants + observers
    +     * @param ObserverCount
    +     *            number of observers
    +     * @param authConfigs
    +     *            configuration parameters for authentication
    +     * @param authServerCount
    +     *            number of auth enabled servers
    +     * @return client port for the respective servers
    +     * @throws IOException
    +     */
    +    protected String startQuorum(final int serverCount, int ObserverCount,
    +            Map<String, String> authConfigs, int authServerCount)
    +                    throws IOException {
    +        StringBuilder connectStr = new StringBuilder();
    +        final int[] clientPorts = startQuorum(serverCount, 0, connectStr,
    +                authConfigs, authServerCount);
    +        for (int i = 0; i < serverCount; i++) {
    +            Assert.assertTrue("waiting for server " + i + " being up",
    +                    ClientBase.waitForServerUp("127.0.0.1:" + clientPorts[i],
    +                            ClientBase.CONNECTION_TIMEOUT));
    +        }
    +        return connectStr.toString();
    +    }
    +
    +    /**
    +     * Starts the given number of quorum servers and won't wait for the quorum
    +     * formation.
    +     *
    +     * @param serverCount
    +     *            total server count includes participants + observers
    +     * @param ObserverCount
    +     *            number of observers
    +     * @param connectStr
    +     *            connection string where clients can used for connection
    +     *            establishment
    +     * @param authConfigs
    +     *            configuration parameters for authentication
    +     * @param authServerCount
    +     *            number of auth enabled servers
    +     * @return client port for the respective servers
    +     * @throws IOException
    +     */
    +    protected int[] startQuorum(final int serverCount, int ObserverCount,
    --- End diff --
    
    ditto about variable ObserverCount being uppercased 


---
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.
---

[GitHub] zookeeper issue #131: ZOOKEEPER-2650: Test Improvement by adding more Quorum...

Posted by rakeshadr <gi...@git.apache.org>.
Github user rakeshadr commented on the issue:

    https://github.com/apache/zookeeper/pull/131
  
    ping @rgs1, would be great to see your feedback. Thanks!


---
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.
---

[GitHub] zookeeper issue #131: ZOOKEEPER-2650: Test Improvement by adding more Quorum...

Posted by rakeshadr <gi...@git.apache.org>.
Github user rakeshadr commented on the issue:

    https://github.com/apache/zookeeper/pull/131
  
    Thanks @rgs1, fixed review comments. Also, added retires for ServerState assertion to improve test case stability.


---
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.
---