You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by anmolnar <gi...@git.apache.org> on 2018/10/01 14:48:10 UTC

[GitHub] zookeeper pull request #651: ZOOKEEPER-3113 EphemeralType.get() fails to ver...

GitHub user anmolnar opened a pull request:

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

    ZOOKEEPER-3113 EphemeralType.get() fails to verify ephemeralOwner when currentElapsedTime() is small enough

    I refactored the unit test `testServerIds` to verify server id verification code explicitly instead of through `EphemeralType.get()` method. 
    
    Reasons:
    - The original test doesn't work on machines which booted recently, because the generated `Time.currentElapsedTime()` value is not high enough and it's possible to generate a valid ephemeralOwner even with high 0xff byte. Server ID cannot be verified reliably this way.
    - EphemeralType.get() is already covered in other unit tests,  
    - Unit tests should test the smallest piece of logic and call the method under testing directly.


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

    $ git pull https://github.com/anmolnar/zookeeper ZOOKEEPER-3113

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

    https://github.com/apache/zookeeper/pull/651.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 #651
    
----
commit 659fc9a4158fed6a6c9eaca8b6725bdbdb9435c0
Author: Andor Molnar <an...@...>
Date:   2018-10-01T14:42:02Z

    ZOOKEEPER-3113. Refactored unit test to validate server Id verification code explicitly

----


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    retest this please


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2447/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2406/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    @hanm do you still -1 this?


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    @hanm do you accept this patch with my recent changes?


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    retest this please


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2423/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2334/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2382/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    @hanm No problem. I'll write some new tests to validate the edge cases of `EphemeralType.get()`.


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    one comment - it would be good for the updated test of EphemeralType.get to cover the code path of throwing an IllegalArgumentException. This was what I referred to in my original comment about reduced code coverage, because neither of the new tests actually tests the presence of this exception under certain conditions.


---

[GitHub] zookeeper pull request #651: ZOOKEEPER-3113 EphemeralType.get() fails to ver...

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

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


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2425/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2428/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    LGTM. Did not notice the newly added method was actually covering that code path. Thanks @anmolnar for following up!


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    retest this please


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    retest this please


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2411/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    retest this please


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2336/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/2298/



---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    Committed. Thanks for the reviews.
    @hanm If you still do have any concerns, please let me know, I'll address them in a separate patch.


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    retest this please


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    Thanks folks for the review. 
    Need approval from a committer. @hanm ?


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    @hanm According to Clover report:
    https://builds.apache.org/view/S-Z/view/ZooKeeper/job/ZooKeeper-trunk-clover/184/clover-report/org/apache/zookeeper/server/EphemeralType.html
    The method in question (line 178) is already covered by `testEphemeralOwner_extendedFeature_extendedTypeUnsupported()`. (introduced in this patch)
    What else do we need here? 


---

[GitHub] zookeeper issue #651: ZOOKEEPER-3113 EphemeralType.get() fails to verify eph...

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

    https://github.com/apache/zookeeper/pull/651
  
    retest this please


---