geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [07/18] incubator-geode git commit: GEODE-1805 Now test retries to fetch the all pr-meta-data
Date Tue, 06 Sep 2016 17:23:31 GMT
GEODE-1805 Now test retries to fetch the all pr-meta-data


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/49facb8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/49facb8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/49facb8b

Branch: refs/heads/feature/GEODE-420
Commit: 49facb8b5d627ddebbeb4aeb87aacdcf88f2ee04
Parents: 8a644c2
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Thu Sep 1 09:33:27 2016 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Thu Sep 1 09:34:13 2016 -0700

----------------------------------------------------------------------
 .../PartitionedRegionSingleHopDUnitTest.java    | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/49facb8b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
index 78fd5e0..470a8d4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
@@ -978,7 +978,7 @@ public class PartitionedRegionSingleHopDUnitTest extends JUnit4CacheTestCase
{
       return finished;
     });
   }
-
+  
   @Test
   public void testClientMetadataForPersistentPrs() throws Exception {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer(
3, 4 ));
@@ -994,7 +994,8 @@ public class PartitionedRegionSingleHopDUnitTest extends JUnit4CacheTestCase
{
     member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
 
     createClient(port0, port1, port2, port3);
-    fetchAndValidateMetadata();
+    Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> fetchAndValidateMetadata());
+    
     member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
     member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
     member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
@@ -1011,17 +1012,18 @@ public class PartitionedRegionSingleHopDUnitTest extends JUnit4CacheTestCase
{
     fetchAndValidateMetadata();
   }
 
-  private void fetchAndValidateMetadata() {
+  private boolean fetchAndValidateMetadata() {
     ClientMetadataService service = ((GemFireCacheImpl)this.cache)
         .getClientMetadataService();
     service.getClientPRMetadata((LocalRegion)this.region);
     HashMap<ServerLocation, HashSet<Integer>> servers = service
-        .groupByServerToAllBuckets(this.region, true);
+        .groupByServerToAllBuckets(this.region, true);    
     if (servers == null) {
-      fail("The client metadata contains no servers for region "
-          + this.region.getFullPath());
+      //fail("The client metadata contains no servers for region "
+        //  + this.region.getFullPath());
+      return false;
     }
-    else {
+    else if(servers.size() == 4) {
       region.getCache().getLogger().fine("The client metadata contains the following "
           + servers.size() + " servers for region " + this.region.getFullPath()
           + ":");
@@ -1029,9 +1031,11 @@ public class PartitionedRegionSingleHopDUnitTest extends JUnit4CacheTestCase
{
         region.getCache().getLogger().fine(entry.getKey() + "->" + entry.getValue());
       }
       if (servers.size() < 4) {
-        fail("Servers size is " +servers.size() + " less than expected 4.");
-      }
+        region.getCache().getLogger().info("Servers size is " +servers.size() + " less than
expected 4.");
+        return false;
+      }      
     }
+    return true;
   }
 
   public static void verifyMetadata(Map<Integer, List<BucketServerLocation66>>
clientMap){


Mime
View raw message