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 TopicReaderTest.testMultiReaderIsAbleToSeekWithTimeOnMiddleOfTopic #17147

Conversation

nicoloboschi
Copy link
Contributor

Motivation

Sometimes this test fails with

java.lang.AssertionError: Received duplicate message msg num 5 expected [true] but found [false]
	at org.testng.Assert.fail(Assert.java:99)
	at org.testng.Assert.failNotEquals(Assert.java:1037)
	at org.testng.Assert.assertTrue(Assert.java:45)
	at org.apache.pulsar.client.api.TopicReaderTest.testMultiReaderIsAbleToSeekWithTimeOnMiddleOfTopic(TopicReaderTest.java:1404)

This is because while the reader tries to seek to a fixed position, the dispatcher have already sent messages starting from the Earliest position.
Even if the consumer on the client side empties the incoming messages after the cursor reset, the messages may already be on the client side and not enqued yet. I think this is a little defeat of the seek feature

Modifications

  • Test seek() resetting the cursor before the current position (Latest) and improved the test checks
  • doc-not-needed

@nicoloboschi nicoloboschi force-pushed the fix-test-testMultiReaderIsAbleToSeekWithTimeOnMiddleOfTopic branch from 54febc8 to 6b5ef38 Compare August 18, 2022 06:41
@nicoloboschi nicoloboschi requested review from eolivelli, 315157973 and yjshen and removed request for eolivelli and 315157973 August 22, 2022 07:07
@mattisonchao
Copy link
Member

I think it is not the test problem. maybe we can try to fix the seek operation.

FYI: #16757 (comment)

@nicoloboschi
Copy link
Contributor Author

OK great, didn't notice that pull, will close this pull

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.

2 participants