Skip to content

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 315157973, eolivelli and yjshen and removed request for 315157973 and eolivelli 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