You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/03/10 00:09:08 UTC

[GitHub] [geode-native] pivotal-jbarrett commented on a change in pull request #760: GEODE-8925: port singleHop tests to new framework

pivotal-jbarrett commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r590848984



##########
File path: cppcache/src/TcrMessage.cpp
##########
@@ -1530,7 +1530,7 @@ void TcrMessage::handleByteArrayResponse(
           }
           m_metadata->push_back(bucketServerLocations);
         }
-        LOGFINER("Metadata size is %", m_metadata->size());
+        LOGFINER("Metadata size is %d", m_metadata->size());

Review comment:
       I believe the `%zu` is what you want for `size_t` values.

##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -168,97 +186,67 @@ void putPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
 
   int ENTRIES = 30;
 
-  putEntries(region, ENTRIES, 0);
-
-  cluster.getServers()[1].stop();
-
-  putEntries(region, ENTRIES, 1);
-
-  cluster.getServers()[1].start();
-
-  putEntries(region, ENTRIES, 2);
-}
+  putEntries(region, ENTRIES, 0, isAllOp);
 
-void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
-  Cluster cluster{LocatorCount{1}, ServerCount{2}};
-  cluster.start();
-  cluster.getGfsh()
-      .create()
-      .region()
-      .withName("region")
-      .withType("PARTITION")
-      .withRedundantCopies("1")
-      .execute();
-
-  auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
-  auto region = setupRegion(cache, pool);
-
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
-
-  getEntries(region, ENTRIES);
+  getEntries(region, ENTRIES, isAllOp);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getEntries(region, ENTRIES, isAllOp);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getEntries(region, ENTRIES, isAllOp);
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all gets are still served.
+ * when one server goes down, all puts and gets are still served.
  * Single-hop is enabled in the client.
  * It can be observed in the logs that when one of the server goes down
  * the bucketServerLocations for that server are removed from the
  * client metadata.
  */
 TEST(PartitionRegionOpsTest,
-     getPartitionedRegionWithRedundancyServerGoesDownSingleHop) {
+     putgetPartitionedRegionWithRedundancyServerGoesDownSingleHop) {

Review comment:
       An appropriately encompassing test class name with appropriately descriptive test names should cover it. The problem with the old style was it preferred keyboard conservation over readability and maintainability. I would rather see duplicate code with one minor change than a method with several boolean flags.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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