From dev-return-73960-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Oct 1 16:48:12 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 33AC5180660 for ; Mon, 1 Oct 2018 16:48:12 +0200 (CEST) Received: (qmail 8780 invoked by uid 500); 1 Oct 2018 14:48:11 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 8768 invoked by uid 99); 1 Oct 2018 14:48:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2018 14:48:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7B801DFC7A; Mon, 1 Oct 2018 14:48:10 +0000 (UTC) From: anmolnar To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org Message-ID: Subject: [GitHub] zookeeper pull request #651: ZOOKEEPER-3113 EphemeralType.get() fails to ver... Content-Type: text/plain Date: Mon, 1 Oct 2018 14:48:10 +0000 (UTC) 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 Date: 2018-10-01T14:42:02Z ZOOKEEPER-3113. Refactored unit test to validate server Id verification code explicitly ---- ---