Skip to content

Commit

Permalink
Fix flaky test BrokerBkEnsemblesTests.testCrashBrokerWithoutCursorLed…
Browse files Browse the repository at this point in the history
…gerLeak (apache#14519)

- wrap assertion with Awaitility
  • Loading branch information
shibd authored Mar 2, 2022
1 parent daed6a0 commit 40e408d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.Schema;
import org.apache.zookeeper.ZooKeeper;
import org.awaitility.Awaitility;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -150,7 +151,9 @@ public void testCrashBrokerWithoutCursorLedgerLeak() throws Exception {
Assert.assertNotEquals(cursorLedgerId, newCursorLedgerId);

// cursor node must be deleted
Assert.assertNull(zk.exists(ledgerPath, false));
Awaitility.await().untilAsserted(() -> {
Assert.assertNull(zk.exists(ledgerPath, false));
});

producer.close();
consumer.close();
Expand Down

0 comments on commit 40e408d

Please sign in to comment.