pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

Flaky-test: DeadLetterTopicTest.testPossibleToDeadLetterEntryIsRemovedWhenRedeliveringABatchMessageId

Open Denovo1998 opened this issue 1 month ago • 4 comments

Search before reporting

  • [x] I searched in the issues and found nothing similar.

Example failure

https://github.com/apache/pulsar/actions/runs/40343686774/job/121715823806?pr=27022

Exception stacktrace

Gradle suite > Gradle test > org.apache.pulsar.client.api.DeadLetterTopicTest > testPossibleToDeadLetterEntryIsRemovedWhenRedeliveringABatchMessageId FAILED

java.lang.AssertionError:
Expected size: 1 but was: 0 in:
{}

at org.apache.pulsar.client.api.DeadLetterTopicTest.testPossibleToDeadLetterEntryIsRemovedWhenRedeliveringABatchMessageId(DeadLetterTopicTest.java:1822)

336 tests completed, 1 failed, 161 skipped

> Task :pulsar-broker:test FAILED
BUILD FAILED in 3m 43s

java.lang.AssertionError:
Expected size: 1 but was: 0 in:
{277:0:-1=[org.apache.pulsar.client.impl.MessageImpl@35f0c8be,
    org.apache.pulsar.client.impl.MessageImpl@123ae69,
    org.apache.pulsar.client.impl.MessageImpl@3990bf84,
    org.apache.pulsar.client.impl.MessageImpl@3fd9a536,
    org.apache.pulsar.client.impl.MessageImpl@c5f3f4b]}

    at org.apache.pulsar.client.api.DeadLetterTopicTest.testPossibleToDeadLetterEntryIsRemovedWhenRedeliveringABatchMessageId(DeadLetterTopicTest.java:1822)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:565)
    at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:141)
    at org.testng.internal.invokers.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:47)
    at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:76)
    at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
    at java.base/java.lang.Thread.run(Thread.java:1474)

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

Denovo1998 avatar Oct 27 '26 01:10 Denovo1998

PR #26477 The new test has an asynchronous timing state: the in-batch message is first delivered to the internal actuator, and then written to the DLQ candidate table. Therefore, when receive() returns five times, the candidate table may still be empty, resulting in the immediate execution of hasSiz E(1) Occasional failure. It is recommended that the minimum repair only adjust the test: change the assertion to Awaitility.await().untilAsserted(() -> assertThat(consumerImpl.getPossibleSendTo DeadLetterTopicMessages()).hasSize(1)), wait for the candidate registration to be completed before triggering the directional re-drop, and keep the logic of subsequent verification that all messages arrive at DLQ and the candidate table is finally empty.

Denovo1998 avatar Oct 27 '26 01:10 Denovo1998

would like to look into this, could i be assigned?

PrakarshSrivastav avatar Oct 27 '26 22:10 PrakarshSrivastav

would like to look into this, could i be assigned?

Of course.

Denovo1998 avatar Oct 28 '26 00:10 Denovo1998

@Denovo1998 kindly check #27152

PrakarshSrivastav avatar Oct 28 '26 14:10 PrakarshSrivastav