boglesby commented on code in PR #7493:
URL: https://github.com/apache/geode/pull/7493#discussion_r843376433


##########
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java:
##########
@@ -368,6 +377,36 @@ private static void createNoSingleHopCacheClient(String 
host, Integer port1, Int
     assertNotNull(region);
   }
 
+  private static void createNoSingleHopCacheClient(String host,
+      Integer port1, Integer port2, Integer port3, int connectTimeout) {
+    CacheServerTestUtil.disableShufflingOfEndpoints();
+
+    Pool p;
+    try {
+      PoolFactory factory = PoolManager.createFactory().addServer(host, port1)
+          .addServer(host, port2).addServer(host, port3).setPingInterval(2000)
+          
.setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setReadTimeout(2000)
+          .setSocketBufferSize(1000).setRetryAttempts(0)
+          .setSocketConnectTimeout(connectTimeout)
+          .setPRSingleHopEnabled(false);
+      if (connectTimeout > 0) {
+        factory.setSocketConnectTimeout(connectTimeout);
+      }

Review Comment:
   setConnectionTimeout is already being done right above this, so this check 
isn't necessary.



##########
geode-dunit/src/main/java/org/apache/geode/internal/cache/functions/TestFunction.java:
##########
@@ -1041,6 +1044,20 @@ private void executeGetNetworkHop(FunctionContext 
context) {
     context.getResultSender().lastResult(networkHopType);
   }
 
+  private void executeSlowFunction(FunctionContext context) {
+    int entries = 4;
+    int waitBetweenEntriesMs = 5000;
+    for (int i = 0; i < entries; i++) {
+      try {
+        Thread.sleep(waitBetweenEntriesMs);
+      } catch (InterruptedException e) {
+        e.printStackTrace();

Review Comment:
   I see other methods in this class are calling printStackTrace, but I'm not 
sure thats the best behavior here.



##########
geode-dunit/src/main/java/org/apache/geode/internal/cache/functions/TestFunction.java:
##########
@@ -1097,6 +1114,10 @@ public void init(Properties props) {
   @Override
   public boolean isHA() {
 
+    if (getId().equals(TEST_FUNCTION_SLOW)) {
+      return false;
+    }
+

Review Comment:
   This check can be moved down to the code below in the method like:
   ```
   if (getId().equals(TEST_FUNCTION_NONHA_SERVER) || 
getId().equals(TEST_FUNCTION_NONHA_REGION)
       || getId().equals(TEST_FUNCTION_NONHA_NOP) || 
getId().equals(TEST_FUNCTION_NONHA)
       || getId().equals(TEST_FUNCTION_SLOW)) {
     return false;
   }
   ```



##########
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java:
##########
@@ -368,6 +377,36 @@ private static void createNoSingleHopCacheClient(String 
host, Integer port1, Int
     assertNotNull(region);
   }
 
+  private static void createNoSingleHopCacheClient(String host,
+      Integer port1, Integer port2, Integer port3, int connectTimeout) {
+    CacheServerTestUtil.disableShufflingOfEndpoints();
+
+    Pool p;
+    try {
+      PoolFactory factory = PoolManager.createFactory().addServer(host, port1)
+          .addServer(host, port2).addServer(host, port3).setPingInterval(2000)
+          
.setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setReadTimeout(2000)
+          .setSocketBufferSize(1000).setRetryAttempts(0)

Review Comment:
   You don't need subscriptions in this test.



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

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to