*Motivation*

DispatcherBlockConsumerTest#testBrokerSubscriptionRecovery is flaky.

```
Stacktrace
java.lang.AssertionError: expected [true] but found [false]
        at org.testng.Assert.fail(Assert.java:96)
        at org.testng.Assert.failNotEquals(Assert.java:776)
        at org.testng.Assert.assertTrue(Assert.java:44)
        at org.testng.Assert.assertTrue(Assert.java:54)
        at 
org.apache.pulsar.client.api.DispatcherBlockConsumerTest.testBrokerSubscriptionRecovery(DispatcherBlockConsumerTest.java:651)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
        at 
org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
        at 
org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
```

The problem is `Consumer.acknowledge` doesn't guarantee a message is acked, it 
only guarantees an ack request is sent back to the broker.

*Changes*

Update the validation logic to check `unackMsgs` are redelivered.



[ Full content available at: https://github.com/apache/pulsar/pull/2643 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to