Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5817182C8 for ; Mon, 2 Nov 2015 21:52:55 +0000 (UTC) Received: (qmail 53950 invoked by uid 500); 2 Nov 2015 21:52:55 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 53906 invoked by uid 500); 2 Nov 2015 21:52:55 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 53896 invoked by uid 99); 2 Nov 2015 21:52:55 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2015 21:52:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 36DF61A0A9C for ; Mon, 2 Nov 2015 21:52:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id uAZNqJmCSSvx for ; Mon, 2 Nov 2015 21:52:51 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id D440D25DC8 for ; Mon, 2 Nov 2015 21:52:34 +0000 (UTC) Received: (qmail 48007 invoked by uid 99); 2 Nov 2015 21:52:28 -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, 02 Nov 2015 21:52:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 75DB1E0A1A; Mon, 2 Nov 2015 21:52:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Mon, 02 Nov 2015 21:52:56 -0000 Message-Id: <45d964cf3c8d4943b21439c6ffa410f4@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [30/50] [abbrv] incubator-geode git commit: [fixes GEODE-456] Fixes a race condition in the test by waiting for the condition instead. [fixes GEODE-456] Fixes a race condition in the test by waiting for the condition instead. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/20c39d7f Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/20c39d7f Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/20c39d7f Branch: refs/heads/feature/GEODE-328 Commit: 20c39d7f3ee100a80f0243c8dbd4b598653ea951 Parents: 791a418 Author: eshu Authored: Fri Oct 23 10:34:29 2015 -0700 Committer: eshu Committed: Fri Oct 23 10:37:24 2015 -0700 ---------------------------------------------------------------------- .../cache/PartitionedRegionSingleHopDUnitTest.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20c39d7f/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java index 0e2ec72..95ead5d 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java @@ -1110,7 +1110,19 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService(); cms.getClientPRMetadata((LocalRegion)region); - Map regionMetaData = cms.getClientPRMetadata_TEST_ONLY(); + final Map regionMetaData = cms.getClientPRMetadata_TEST_ONLY(); + + WaitCriterion wc = new WaitCriterion() { + public boolean done() { + return (regionMetaData.size() == 1); + } + + public String description() { + return "expected metadata is ready"; + } + }; + DistributedTestCase.waitForCriterion(wc, 60000, 1000, true); + assertEquals(1, regionMetaData.size()); assertTrue(regionMetaData.containsKey(region.getFullPath())); @@ -1134,7 +1146,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { ClientPartitionAdvisor prMetaData = regionMetaData.get(region.getFullPath()); final Map> clientMap = prMetaData.getBucketServerLocationsMap_TEST_ONLY(); - WaitCriterion wc = new WaitCriterion() { + wc = new WaitCriterion() { public boolean done() { return (clientMap.size() == 4); }