mivanac commented on a change in pull request #6909:
URL: https://github.com/apache/geode/pull/6909#discussion_r728922649



##########
File path: 
geode-core/src/test/java/org/apache/geode/internal/cache/PRHARedundancyProviderTest.java
##########
@@ -285,6 +285,25 @@ public void 
startTaskCompletesExceptionallyIfExceptionIsThrown(
     verify(providerStartupTask).completeExceptionally(exception);
   }
 
+  @Test
+  public void reportsScheduleCreateMissingBuckets() {

Review comment:
       Updated

##########
File path: 
geode-core/src/test/java/org/apache/geode/internal/cache/PRHARedundancyProviderTest.java
##########
@@ -285,6 +285,25 @@ public void 
startTaskCompletesExceptionallyIfExceptionIsThrown(
     verify(providerStartupTask).completeExceptionally(exception);
   }
 
+  @Test
+  public void reportsScheduleCreateMissingBuckets() {
+    CompletableFuture<Void> providerStartupTask = 
mock(CompletableFuture.class);
+    when(partitionedRegion.getColocatedWith()).thenReturn("leaderRegion");
+    when(partitionedRegion.getGemFireCache()).thenReturn(cache);
+    when(cache.getInternalResourceManager()).thenReturn(resourceManager);
+
+    ScheduledExecutorService executorService = 
mock(ScheduledExecutorService.class);
+    when(resourceManager.getExecutor()).thenReturn(executorService);
+
+    prHaRedundancyProvider = new PRHARedundancyProvider(partitionedRegion, 
resourceManager,
+        (a, b) -> mock(PersistentBucketRecoverer.class),
+        PRHARedundancyProviderTest::createRebalanceOp, providerStartupTask);
+
+    prHaRedundancyProvider.scheduleCreateMissingBuckets();
+
+    verify(executorService).execute(any());

Review comment:
       Updated

##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/CreateMissingBucketsTask.java
##########
@@ -58,4 +74,44 @@ protected void createMissingBuckets(PartitionedRegion 
region) {
       }
     }
   }
+
+  /**
+   * Wait for Colocation to complete. Wait all nodes to Register this 
PartitionedRegion.
+   */
+  protected boolean waitForColocationCompleted(PartitionedRegion 
partitionedRegion) {
+    int retryCount = 0;
+    int sleepInterval = 
PartitionedRegionHelper.DEFAULT_WAIT_PER_RETRY_ITERATION;
+
+    while (!ColocationHelper.isColocationComplete(partitionedRegion)
+        && (retryCount < MAX_NUMBER_INTERVALS)) {
+
+      // Didn't time out. Sleep a bit and then continue
+      boolean interrupted = Thread.interrupted();
+      try {
+        Thread.sleep(sleepInterval);

Review comment:
       Updated




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