From commits-return-14591-archive-asf-public=cust-asf.ponee.io@pulsar.incubator.apache.org Tue Sep 18 11:18:21 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 4DFBD180677 for ; Tue, 18 Sep 2018 11:18:21 +0200 (CEST) Received: (qmail 39333 invoked by uid 500); 18 Sep 2018 09:18:20 -0000 Mailing-List: contact commits-help@pulsar.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.incubator.apache.org Delivered-To: mailing list commits@pulsar.incubator.apache.org Received: (qmail 39324 invoked by uid 99); 18 Sep 2018 09:18:20 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2018 09:18:20 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] sijie closed pull request #2598: [tests] Flaky Test ZooKeeperCacheTest#testChildrenCacheZnodeCreatedAfterCache Message-ID: <153726229968.22902.16766566597183663266.gitbox@gitbox.apache.org> Date: Tue, 18 Sep 2018 09:18:19 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit sijie closed pull request #2598: [tests] Flaky Test ZooKeeperCacheTest#testChildrenCacheZnodeCreatedAfterCache URL: https://github.com/apache/incubator-pulsar/pull/2598 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-zookeeper-utils/src/test/java/org/apache/pulsar/zookeeper/ZookeeperCacheTest.java b/pulsar-zookeeper-utils/src/test/java/org/apache/pulsar/zookeeper/ZookeeperCacheTest.java index 09c3ea1524..39f23ac59f 100644 --- a/pulsar-zookeeper-utils/src/test/java/org/apache/pulsar/zookeeper/ZookeeperCacheTest.java +++ b/pulsar-zookeeper-utils/src/test/java/org/apache/pulsar/zookeeper/ZookeeperCacheTest.java @@ -209,12 +209,14 @@ void testChildrenCacheZnodeCreatedAfterCache() throws Exception { Thread.sleep(1); } + final int recvNotifications = notificationCount.get(); + assertEquals(cache.get(), new TreeSet(Lists.newArrayList("z1"))); assertEquals(cache.get("/test"), new TreeSet(Lists.newArrayList("z1"))); - assertEquals(notificationCount.get(), 1); + assertTrue(recvNotifications == 1 || recvNotifications == 2); zkClient.delete("/test/z1", -1); - while (notificationCount.get() < 2) { + while (notificationCount.get() < (recvNotifications + 1)) { Thread.sleep(1); } @@ -230,7 +232,7 @@ void testChildrenCacheZnodeCreatedAfterCache() throws Exception { // Ok } - assertEquals(notificationCount.get(), 2); + assertEquals(notificationCount.get(), (recvNotifications + 1)); } @Test(timeOut = 10000) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services