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:
[email protected]