geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [41/50] [abbrv] incubator-geode git commit: [fixes GEODE-456] Fixes a race condition in the test by waiting for the condition instead.
Date Mon, 26 Oct 2015 18:29:04 GMT
[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/develop
Commit: 20c39d7f3ee100a80f0243c8dbd4b598653ea951
Parents: 791a418
Author: eshu <eshu@pivotal.io>
Authored: Fri Oct 23 10:34:29 2015 -0700
Committer: eshu <eshu@pivotal.io>
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<String, ClientPartitionAdvisor> regionMetaData = cms.getClientPRMetadata_TEST_ONLY();
   
+    final Map<String, ClientPartitionAdvisor> 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<Integer, List<BucketServerLocation66>> clientMap  = prMetaData.getBucketServerLocationsMap_TEST_ONLY();
-    WaitCriterion wc = new WaitCriterion() {
+    wc = new WaitCriterion() {
       public boolean done() {
         return (clientMap.size() == 4);
       }


Mime
View raw message