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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...
Date Fri, 19 May 2017 20:25:45 GMT
Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/257#discussion_r117566584
  
    --- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
    @@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
             LOG.info("Election port: " + port);
             Thread.sleep(1000);
     
    -        Socket sock = new Socket();
    -        sock.connect(peers.get(1L).electionAddr, 5000);
    -        long begin = Time.currentElapsedTime();
    -        // Read without sending data. Verify timeout.
    -        cnxManager.receiveConnection(sock);
    -        long end = Time.currentElapsedTime();
    -        if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 500)) Assert.fail("Waited
more than necessary");
    -        cnxManager.halt();
    -        Assert.assertFalse(cnxManager.listener.isAlive());
    +        try (Socket sock = new Socket()) {
    --- End diff --
    
    +1, although please feel free to submit a jira and fix it there!


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