mhansonp commented on a change in pull request #6802:
URL: https://github.com/apache/geode/pull/6802#discussion_r700620863



##########
File path: 
geode-gfsh/src/test/java/org/apache/geode/management/internal/cli/functions/WanCopyRegionFunctionTest.java
##########
@@ -562,13 +562,13 @@ public void 
wanCopyRegion_verifyExceptionThrownWhenExceptionWhileSendingBatch()
   public void 
executeWanCopyRegionFunctionInNewThread_verifyErrorWhenAlreadyRunningCommand()
       throws BatchException70, InterruptedException, ExecutionException {
     Object[] options = new Object[] {"myRegion", "mySender", false, 1L, 1};
-    Future<CliFunctionResult> future = 
executeAsyncWanCopyRegionFunction(options);
+    Future<CliFunctionResult> future = 
executeAsyncWanCopyRegionFunction(options, 1000);
 
     // Wait for the execute function to start
-    Thread.sleep(100);
+    Thread.sleep(500L);

Review comment:
       Is there something we can wait on rather than just using a Thread.sleep?

##########
File path: 
geode-gfsh/src/test/java/org/apache/geode/management/internal/cli/functions/WanCopyRegionFunctionTest.java
##########
@@ -562,13 +562,13 @@ public void 
wanCopyRegion_verifyExceptionThrownWhenExceptionWhileSendingBatch()
   public void 
executeWanCopyRegionFunctionInNewThread_verifyErrorWhenAlreadyRunningCommand()
       throws BatchException70, InterruptedException, ExecutionException {
     Object[] options = new Object[] {"myRegion", "mySender", false, 1L, 1};
-    Future<CliFunctionResult> future = 
executeAsyncWanCopyRegionFunction(options);
+    Future<CliFunctionResult> future = 
executeAsyncWanCopyRegionFunction(options, 1000);

Review comment:
       Can you add a constant for the magic "1000" so we know why it is there?

##########
File path: 
geode-gfsh/src/test/java/org/apache/geode/management/internal/cli/functions/WanCopyRegionFunctionTest.java
##########
@@ -579,17 +579,42 @@ public void 
executeWanCopyRegionFunctionInNewThread_verifyErrorWhenAlreadyRunnin
     future.get();
   }
 
+  @Test
+  public void executeWanCopyRegionFunctionInNewThread_cancelExecution()
+      throws ExecutionException, InterruptedException, BatchException70 {
+    Object[] options1 = new Object[] {"myRegion", "mySender", false, 1L, 1};
+    Future<CliFunctionResult> future1 = 
executeAsyncWanCopyRegionFunction(options1, 10000);
+
+    // Wait for the function to start execution
+    Thread.sleep(1000L);

Review comment:
       Is there something that we could be waiting on rather than a sleep?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to