From 69751ee9178bdc54284d10de102e6e6ac90f350b Mon Sep 17 00:00:00 2001 From: nicklixinyang Date: Tue, 26 Jul 2022 19:30:21 +0800 Subject: [PATCH] fix flaky test in PulsarSinkE2ETest.testPulsarSinkDLQ --- .../test/java/org/apache/pulsar/io/PulsarSinkE2ETest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarSinkE2ETest.java b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarSinkE2ETest.java index 24bea1d59940c..f86a45a801da5 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarSinkE2ETest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarSinkE2ETest.java @@ -189,6 +189,11 @@ public void testPulsarSinkDLQ() throws Exception { remainingMessagesToReceive.add(messageBody); } + // Wait all msg show in dlqTopic. + Awaitility.await().untilAsserted(()-> { + assertEquals(admin.topics().getLastMessageId(dlqTopic).toString(),"10:1:-1:8"); + }); + //4 All messages should enter DLQ for (int i = 0; i < totalMsgs; i++) { Message message = consumer.receive(10, TimeUnit.SECONDS);