oneby-wang commented on code in PR #25117:
URL: https://github.com/apache/pulsar/pull/25117#discussion_r2672158723


##########
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java:
##########
@@ -5144,20 +5158,23 @@ public void markDeleteFailed(ManagedLedgerException 
exception, Object ctx) {
         }, null);
 
         latch.await();
-        assertEquals(cursor.getPersistentMarkDeletedPosition(), lastPosition);
-        assertEquals(ledger.getCursors().getSlowestCursorPosition(), 
lastPosition);
-        assertEquals(cursor.getProperties(), properties);
+        
assertThat(cursor.getPersistentMarkDeletedPosition()).isGreaterThanOrEqualTo(lastPosition);
+        
assertThat(ledger.getCursors().getSlowestCursorPosition()).isGreaterThanOrEqualTo(lastPosition);
+        // cursor.asyncMarkDelete() and 
maybeUpdateCursorBeforeTrimmingConsumedLedger may run concurrently,
+        // so we can't assert properties equals here.
+        // assertEquals(cursor.getProperties(), properties);

Review Comment:
   > BTW, could it be replaced by Awaitility.await()?
   
   Seems can't, the race condition in mark delete and ledger rollover cause 
this test flaky, and may impact the properties user set in `asyncDelete` 
process.



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