zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afine <...@git.apache.org>
Subject [GitHub] zookeeper pull request #474: ZOOKEEPER-2977: Concurrency for addAuth corrupt...
Date Fri, 02 Mar 2018 22:44:31 GMT
Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/474#discussion_r171980950
  
    --- Diff: src/java/test/org/apache/zookeeper/server/NIOServerCnxnTest.java ---
    @@ -103,4 +105,22 @@ public void testValidSelectionKey() throws Exception {
                 zk.close();
             }
         }
    +
    +    @Test(timeout = 30000)
    +    public void testServerCnxnGetAuthInfoWithCopy() throws Exception {
    +        final ZooKeeper zk = createZKClient(hostPort, 3000);
    +        try {
    +            Iterable<ServerCnxn> connections = serverFactory.getConnections();
    +            for (ServerCnxn serverCnxn : connections) {
    +            	List<Id> authInfo = serverCnxn.getAuthInfo();
    +            	Id id = new Id("testscheme", "test");
    +				serverCnxn.addAuthInfo(id);
    +				Assert.assertTrue(!authInfo.contains(id));
    --- End diff --
    
    nit: let's use assertFalse


---

Mime
View raw message