Skip to content

Conversation

@aloyszhang
Copy link
Contributor

@aloyszhang aloyszhang commented Nov 8, 2022

Motivation

fix flaky test for PersistentTopicStreamingDispatcherE2ETest#testMessageRedelivery which failed sporadically with the following error

Error:  Tests run: 76, Failures: 1, Errors: 0, Skipped: 54, Time elapsed: 123.672 s <<< FAILURE! - in org.apache.pulsar.broker.service.persistent.PersistentTopicStreamingDispatcherE2ETest
  Error:  testMessageRedelivery(org.apache.pulsar.broker.service.persistent.PersistentTopicStreamingDispatcherE2ETest)  Time elapsed: 1.15 s  <<< FAILURE!
  java.lang.AssertionError: msg should be redelivered 
  	at org.testng.Assert.fail(Assert.java:87)
  	at org.apache.pulsar.broker.service.PersistentTopicE2ETest.testMessageRedelivery(PersistentTopicE2ETest.java:1723)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
  	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:45)
  	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:73)
  	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
  	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  	at java.base/java.lang.Thread.run(Thread.java:833)
  Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.pulsar.client.api.Message.getValue()" because "redeliveredMsg" is null
  	at org.apache.pulsar.broker.service.PersistentTopicE2ETest.lambda$testMessageRedelivery$7(PersistentTopicE2ETest.java:1721)
  	at java.base/java.util.ArrayList.removeIf(ArrayList.java:1672)
  	at java.base/java.util.ArrayList.removeIf(ArrayList.java:1660)
  	at org.apache.pulsar.broker.service.PersistentTopicE2ETest.testMessageRedelivery(PersistentTopicE2ETest.java:1721)
  	... 12 more

Modifications

Set the receiveQueue size to make sure readMoreEntries can truely read more enties when consumer calls redeliverUnacknowledgedMessages

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as PersistentTopicStreamingDispatcherE2ETest#testMessageRedelivery.

Documentation

  • doc-not-needed

Matching PR in forked repository

PR in forked repository: aloyszhang#6

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

@aloyszhang Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@aloyszhang aloyszhang changed the title fix flaky test [fix][test] fix flaky test PersistentTopicStreamingDispatcherE2ETest.testMessageRedelivery Nov 8, 2022
@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Nov 8, 2022
@poorbarcode
Copy link
Contributor

@aloyszhang
Copy link
Contributor Author

Close this pull request since there is another pr to resolve the problem.
cc @poorbarcode

@aloyszhang aloyszhang closed this Nov 9, 2022
@aloyszhang aloyszhang deleted the flaky-test branch November 30, 2022 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants