Skip to content

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

Merged
nicoloboschi merged 1 commit into
apache:masterfrom
nicoloboschi:fix-flaky-dispatcher-block
Aug 31, 2022
Merged

nicoloboschi merged 1 commit into
apache:masterfrom
nicoloboschi:fix-flaky-dispatcher-block

Conversation

@nicoloboschi

Copy link
Copy Markdown
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

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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