You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/25 09:46:31 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #11093: [Issues 11077] fixed flaky test ConsumedLedgersTrimTest

codelipenghui commented on a change in pull request #11093:
URL: https://github.com/apache/pulsar/pull/11093#discussion_r658638158



##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ConsumedLedgersTrimTest.java
##########
@@ -150,8 +150,8 @@ public void testConsumedLedgersTrimNoSubscriptions() throws Exception {
         pulsar.getAdminClient().topics().getStats(topicName);
         MessageId messageIdAfterRestart = pulsar.getAdminClient().topics().getLastMessageId(topicName);
         LOG.info("lastmessageid " + messageIdAfterRestart);
-        assertEquals(messageIdAfterRestart, messageIdBeforeRestart);
-
+        Awaitility.await().untilAsserted(()->
+                assertEquals(messageIdAfterRestart, messageIdBeforeRestart));

Review comment:
       The `messageIdAfterRestart` and `messageIdBeforeRestart` will never be changed when you retry the condition by using Awaitility, so it will not fix the flaky test but increase the test time while `messageIdAfterRestart` not equals `messageIdBeforeRestart`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org