Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][test] Fix flaky test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs #17161

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

nicoloboschi
Copy link
Contributor

Motivation

java.lang.AssertionError: expected [600] but found [265]
	at org.testng.Assert.fail(Assert.java:99)
	at org.testng.Assert.failNotEquals(Assert.java:1037)
	at org.testng.Assert.assertEqualsImpl(Assert.java:140)
	at org.testng.Assert.assertEquals(Assert.java:122)
	at org.testng.Assert.assertEquals(Assert.java:907)
	at org.testng.Assert.assertEquals(Assert.java:917)
	at org.apache.pulsar.client.api.DispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs(DispatcherBlockConsumerTest.java:1036)

Modifications

In the scope of this test is important to not group acks because the ack for messages may happens after receiving a new message from the topic. If the acks are sent in batch it may happen that the dispatcher is still blocked until it receives the batched acks and the Consumer#receive will return null and the test will fail.

  • Set acknowledgmentGroupTime to 0 for the consumer

  • Moved the test to the broker suite (it was flaky)

  • doc-not-needed

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the patch.
But I suggested an alternative fix PTAL

@nicoloboschi
Copy link
Contributor Author

@eolivelli see my response #17161 (comment)

…rTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants