zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anmolnar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #651: ZOOKEEPER-3113 EphemeralType.get() fails to ver...
Date Mon, 01 Oct 2018 14:48:10 GMT
GitHub user anmolnar opened a pull request:


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

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:


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 <andor@...>
Date:   2018-10-01T14:42:02Z

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



View raw message