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/08 21:09:32 UTC

[GitHub] [geode-native] mmartell opened a new pull request #760: GEODE-8925: port singleHop tests to new framework

mmartell opened a new pull request #760:
URL: https://github.com/apache/geode-native/pull/760


   Captures the following flaky tests into the new PartitionedRegionOps test:
   
   - testThinClientPRSingleHop
   - testThinClientPutAllPRSingleHop
   
   


----------------------------------------------------------------
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



[GitHub] [geode-native] pdxcodemonkey commented on pull request #760: GEODE-8925: port singleHop tests to new framework

Posted by GitBox <gi...@apache.org>.
pdxcodemonkey commented on pull request #760:
URL: https://github.com/apache/geode-native/pull/760#issuecomment-808486999


   @mmartell Looks like this one is good to go, but you'll need to rebase onto develop to resolve merge conflicts.


-- 
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



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

Posted by GitBox <gi...@apache.org>.
pdxcodemonkey commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r592474471



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putget(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
+ * when one server goes down, all putAlls and getAlls 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.
- * When the server is brought back again, the meta data is refreshed
- * after putting again values.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownSingleHop) {
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithSingleHop) {
   removeLogFromPreviousExecution();
-  putPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;

Review comment:
       `auto` again

##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;

Review comment:
       `auto`?
   

##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putget(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
+ * when one server goes down, all putAlls and getAlls 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.
- * When the server is brought back again, the meta data is refreshed
- * after putting again values.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownSingleHop) {
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithSingleHop) {
   removeLogFromPreviousExecution();
-  putPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putAllgetAll(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * 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 not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     getPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  getPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putgetWithoutSingleHop) {
+  removeLogFromPreviousExecution();
+  bool useSingleHop = false;

Review comment:
       `auto` again




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
echobravopapa commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r590762097



##########
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());

Review comment:
       guess we've been getting lucky here...

##########
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:
       these 4 TEST go thru the input matrix of `putgetPartitionedRegionWithRedundancyServerGoesDown(bool, bool)` 
   {true,false; false,false; true,true; false,true} and that's great
   I do notice this requires a good bit of comment maintenance, which makes me wonder if there is a better way to present these test cases for posterity/maintainability...
   

##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -89,19 +89,36 @@ std::shared_ptr<Region> setupRegion(Cache& cache,
 }
 
 void putEntries(std::shared_ptr<Region> region, int numEntries,
-                int offsetForValue) {
+                int offsetForValue, bool isAllOp) {

Review comment:
       maybe a better mnemonic for the bool param... idk what `AllOp` means

##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -89,19 +89,36 @@ std::shared_ptr<Region> setupRegion(Cache& cache,
 }
 
 void putEntries(std::shared_ptr<Region> region, int numEntries,
-                int offsetForValue) {
+                int offsetForValue, bool isAllOp) {

Review comment:
       maybe `doAllOperations`  if i'm following the intention here...




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r599909832



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putget(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
+ * when one server goes down, all putAlls and getAlls 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.
- * When the server is brought back again, the meta data is refreshed
- * after putting again values.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownSingleHop) {
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithSingleHop) {
   removeLogFromPreviousExecution();
-  putPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putAllgetAll(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * 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 not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     getPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  getPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putgetWithoutSingleHop) {
+  removeLogFromPreviousExecution();
+  bool useSingleHop = false;
+  putget(useSingleHop);
+  verifyNoMetaData();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
- * Single-hop is not enabled in the client.
+ * when one server goes down, all putAlls and getAlls are still served.
+ *
+ * Single hop is not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  putPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithoutSingleHop) {
+  removeLogFromPreviousExecution();

Review comment:
       Removed reliance on logfile parsing by leveraging CacheImpl::getAndResetNetworkHopFlag(), which was already exported.




-- 
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



[GitHub] [geode-native] mmartell merged pull request #760: GEODE-8925: port singleHop tests to new framework

Posted by GitBox <gi...@apache.org>.
mmartell merged pull request #760:
URL: https://github.com/apache/geode-native/pull/760


   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r591658279



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -89,19 +89,36 @@ std::shared_ptr<Region> setupRegion(Cache& cache,
 }
 
 void putEntries(std::shared_ptr<Region> region, int numEntries,
-                int offsetForValue) {
+                int offsetForValue, bool isAllOp) {

Review comment:
       The refactor has removed the isAllOp parameter in favor of simpler functions.




----------------------------------------------------------------
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



[GitHub] [geode-native] mmartell commented on pull request #760: GEODE-8925: port singleHop tests to new framework

Posted by GitBox <gi...@apache.org>.
mmartell commented on pull request #760:
URL: https://github.com/apache/geode-native/pull/760#issuecomment-807933678


   The two ported tests (testThinClientPRSingleHop and testThinClientPutAllPRSingleHop) have been removed.


-- 
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r590837766



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -89,19 +89,36 @@ std::shared_ptr<Region> setupRegion(Cache& cache,
 }
 
 void putEntries(std::shared_ptr<Region> region, int numEntries,
-                int offsetForValue) {
+                int offsetForValue, bool isAllOp) {

Review comment:
       Yah, I think this aligns with echobravopapa's suggestions above. Please have a look at my refactor suggestion above and let me know if that works.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
pdxcodemonkey commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r592472394



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -163,23 +208,24 @@ void putPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
+  int ENTRIES = 113;

Review comment:
       Should be `const`
   




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r593280409



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putget(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
+ * when one server goes down, all putAlls and getAlls 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.
- * When the server is brought back again, the meta data is refreshed
- * after putting again values.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownSingleHop) {
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithSingleHop) {
   removeLogFromPreviousExecution();
-  putPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putAllgetAll(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * 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 not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     getPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  getPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putgetWithoutSingleHop) {
+  removeLogFromPreviousExecution();
+  bool useSingleHop = false;
+  putget(useSingleHop);
+  verifyNoMetaData();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
- * Single-hop is not enabled in the client.
+ * when one server goes down, all putAlls and getAlls are still served.
+ *
+ * Single hop is not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  putPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithoutSingleHop) {
+  removeLogFromPreviousExecution();

Review comment:
       Investigating adding ClientMetaDataHelper to improve testability of ClientMetaData.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r590836522



##########
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:
       Good call. Since I didn't write this test (or review it), I didn't want to trash it too badly. I think we can do away with many of the comments, which are mostly just duplicated for the four tests, in favor of using better test names. How do you feel about just breaking the single function with parameters (putgetPartitionedRegionWithRedundancyServerGoesDown(singleHop, useAll)) into the four separate aptly named functions with no parameters:
   
       putgetHA
       putgetHAWithSingleHop
       putAllgetAllHA
       putAllGetAllHASingleHop
   
   I think the HA implies failover so we could nuke the comments.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r591657417



##########
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:
       I've refactored to use better test names and less parameters in favor of simpler functions. Decided to leave in most of the test comments as they help describe the complex flow of operations including stop and restarting servers.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r599928664



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putget(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
+ * when one server goes down, all putAlls and getAlls 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.
- * When the server is brought back again, the meta data is refreshed
- * after putting again values.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownSingleHop) {
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithSingleHop) {
   removeLogFromPreviousExecution();
-  putPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putAllgetAll(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * 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 not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     getPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  getPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putgetWithoutSingleHop) {
+  removeLogFromPreviousExecution();
+  bool useSingleHop = false;

Review comment:
       Fixed




-- 
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r599928281



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;

Review comment:
       Created a new ticket (GEODE-9061) for testing TLS (thread local storage).




-- 
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r593286311



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;

Review comment:
       Will delete two old tests (testThinClientPRSinglehop and testThinClientPutallPRSingleHop) after capturing the thread local storage aspect of those tests.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r590812844



##########
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());

Review comment:
       Yah, it just prints as a blank. I needed to fix it to help with my test analysis.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
pdxcodemonkey commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r592473934



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;

Review comment:
       `const` here too




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r593301006



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;

Review comment:
       Probably auto too.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
pdxcodemonkey commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r590835496



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -89,19 +89,36 @@ std::shared_ptr<Region> setupRegion(Cache& cache,
 }
 
 void putEntries(std::shared_ptr<Region> region, int numEntries,
-                int offsetForValue) {
+                int offsetForValue, bool isAllOp) {

Review comment:
       Boolean parameters generally are a code smell (https://medium.com/@amlcurran/clean-code-the-curse-of-a-boolean-parameter-c237a830b7a3), and I don't think these are doing you any favors.  Have a look at refactoring to remove isAllOp altogether, I think it'll be better.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r590819249



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -89,19 +89,36 @@ std::shared_ptr<Region> setupRegion(Cache& cache,
 }
 
 void putEntries(std::shared_ptr<Region> region, int numEntries,
-                int offsetForValue) {
+                int offsetForValue, bool isAllOp) {

Review comment:
       I agree isAllOp is confusing. I don't think doAllOperations is any better. I think this is much better:
   
   - putEntries(..., bool usePutAll)
   - getEntries(..., bool useGetAll)




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r599910104



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -163,23 +208,24 @@ void putPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
+  int ENTRIES = 113;

Review comment:
       Fixed.




-- 
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



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

Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r591745678



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;
 
-  getEntries(region, ENTRIES);
+  putAllEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].stop();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 
   cluster.getServers()[1].start();
 
-  getEntries(region, ENTRIES);
+  getAllEntries(region, ENTRIES);
 }
 
 /**
  * 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) {
+TEST(PartitionRegionWithRedundancyTest, putgetWithSingleHop) {
   removeLogFromPreviousExecution();
-  getPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putget(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
+ * when one server goes down, all putAlls and getAlls 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.
- * When the server is brought back again, the meta data is refreshed
- * after putting again values.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownSingleHop) {
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithSingleHop) {
   removeLogFromPreviousExecution();
-  putPartitionedRegionWithRedundancyServerGoesDown(true);
+  bool useSingleHop = true;
+  putAllgetAll(useSingleHop);
   verifyMetadataWasRemovedAtFirstError();
 }
 
 /**
  * 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 not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     getPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  getPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putgetWithoutSingleHop) {
+  removeLogFromPreviousExecution();
+  bool useSingleHop = false;
+  putget(useSingleHop);
+  verifyNoMetaData();
 }
 
 /**
  * In this test case we verify that in a partition region with redundancy
- * when one server goes down, all puts are still served.
- * Single-hop is not enabled in the client.
+ * when one server goes down, all putAlls and getAlls are still served.
+ *
+ * Single hop is not enabled in the client.
+ *
+ * It can be observed in the logs that no metadata was requested.
  */
-TEST(PartitionRegionOpsTest,
-     putPartitionedRegionWithRedundancyServerGoesDownNoSingleHop) {
-  putPartitionedRegionWithRedundancyServerGoesDown(false);
+TEST(PartitionRegionWithRedundancyTest, putAllgetAllWithoutSingleHop) {
+  removeLogFromPreviousExecution();

Review comment:
       Why are logs involved here at all. Testing base on logs should be avoided at all cost.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r591661522



##########
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:
       Good catch.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mmartell commented on a change in pull request #760:
URL: https://github.com/apache/geode-native/pull/760#discussion_r599911247



##########
File path: cppcache/integration/test/PartitionRegionOpsTest.cpp
##########
@@ -191,74 +237,85 @@ void getPartitionedRegionWithRedundancyServerGoesDown(bool singleHop) {
       .execute();
 
   auto cache = createCache();
-  auto pool = createPool(cluster, cache, singleHop);
+  auto pool = createPool(cluster, cache, useSingleHop);
   auto region = setupRegion(cache, pool);
 
-  int ENTRIES = 30;
-
-  putEntries(region, ENTRIES, 0);
+  int ENTRIES = 113;

Review comment:
       Switched these to constexpr.




-- 
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