From f94669be1c7414234b233cd016bac5be59bacaed Mon Sep 17 00:00:00 2001 From: xymeng <1984997880@qq.com> Date: Fri, 16 Feb 2024 17:17:28 +0800 Subject: [PATCH] flaky test --- .../transaction/pendingack/PendingAckPersistentTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/pendingack/PendingAckPersistentTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/pendingack/PendingAckPersistentTest.java index 2ef8b8f68eee3..1eb04ca1ccf0c 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/pendingack/PendingAckPersistentTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/pendingack/PendingAckPersistentTest.java @@ -460,7 +460,9 @@ public void testDeleteUselessLogDataWhenSubCursorMoved() throws Exception { Message message2 = consumer.receive(5, TimeUnit.SECONDS); consumer.acknowledgeAsync(message2.getMessageId(), transaction2).get(); - Assert.assertEquals(pendingAckLogIndex.size(), 0); + Awaitility.await().untilAsserted(() -> { + Assert.assertEquals(pendingAckLogIndex.size(), 0); + }); maxIndexLag = (long) field4.get(pendingAckStore); Assert.assertEquals(maxIndexLag, 5); }