Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AE427200C25 for ; Fri, 24 Feb 2017 08:40:21 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id ACD05160B5C; Fri, 24 Feb 2017 07:40:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 23C3B160B69 for ; Fri, 24 Feb 2017 08:40:20 +0100 (CET) Received: (qmail 18730 invoked by uid 500); 24 Feb 2017 07:40:20 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 18714 invoked by uid 99); 24 Feb 2017 07:40:19 -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; Fri, 24 Feb 2017 07:40:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9D5C5DFD9E; Fri, 24 Feb 2017 07:40:19 +0000 (UTC) From: oza To: dev@curator.apache.org Reply-To: dev@curator.apache.org References: In-Reply-To: Subject: [GitHub] curator pull request #200: [CURATOR-311] SharedValue could hold stall data a... Content-Type: text/plain Message-Id: <20170224074019.9D5C5DFD9E@git1-us-west.apache.org> Date: Fri, 24 Feb 2017 07:40:19 +0000 (UTC) archived-at: Fri, 24 Feb 2017 07:40:21 -0000 Github user oza commented on a diff in the pull request: https://github.com/apache/curator/pull/200#discussion_r102892185 --- Diff: curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java --- @@ -381,12 +385,122 @@ public void processResult(CuratorFramework client, CuratorEvent event) throws Ex }).forPath("/count"); flushDone.await(5, TimeUnit.SECONDS); - Assert.assertEquals(2, numChangeEvents.get()); + // CURATOR-311: when a Curator client's state became RECONNECTED, countHasChanged method is called back + // because the Curator client calls readValueAndNotifyListenersInBackground in SharedValue#ConnectionStateListener#stateChanged. + Assert.assertEquals(numChangeEvents.get(), 3); --- End diff -- Minor nits: this line also fixes wrong order of the argument of Assert.assertEquals: assertEquals(actual, expected) is correct one. To confirm the reason why I changed numChangeEvents' count, please check the comment in the test code. --- 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. ---