Denovo1998 commented on code in PR #24988:
URL: https://github.com/apache/pulsar/pull/24988#discussion_r2553939784


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/OneWayReplicatorDeduplicationTest.java:
##########
@@ -1025,7 +1027,8 @@ protected void 
handleGetOrCreateSchemaResponse(CommandGetOrCreateSchemaResponse
         p3.close();
         admin1.topics().setReplicationClusters(topicName, 
Arrays.asList(cluster1));
         waitReplicatorStopped(topicName);
-        Awaitility.await().until(() -> {
+        // Added: Wait for replicator to completely stop
+        Awaitility.await().pollDelay(Duration.ofMillis(500)).untilAsserted(() 
-> {

Review Comment:
   @hageshiame Perhaps the inner for loop can be changed to collect conditions, 
and then use assertTrue / assertFalse to express.
   ```java
   // Added: Wait for replicator to completely stop
   Awaitility.await().pollDelay(Duration.ofMillis(500)).untilAsserted(() -> {
       boolean hasReplicatorCursor = false;
       for (ManagedCursor cursor : tp1.getManagedLedger().getCursors()) {
           if (cursor.getName().equals("pulsar.repl.r2")) {
               hasReplicatorCursor = true;
               break;
           }
       }
       assertTrue(!hasReplicatorCursor);
   });
   ```



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