Scanteianu commented on PR #12753:
URL: https://github.com/apache/kafka/pull/12753#issuecomment-1294252160

   > @Scanteianu , thanks for the update, but there is still something wrong. 
For the test, I don't think another tests in MockConsumer is needed and 
correct. After all, MockConsumer is a `Mock` one, some behaviors doesn't match 
the real consumer. For the seek test, we already have one here: 
`PlaintextConsumerTest#testSeek`. If you think there are some tests missing, 
you can add in the test.
   > 
   > BTW, `PlaintextConsumerTest` is integration tests, so it'll launch real 
brokers and consumers to do tests. You can test it there.
   > 
   > Thanks.
   
   @showuon thanks for the review, I really appreciate your taking the time to 
look at it, and point me to the right places in the code to add tests and the 
configs that specify behaviour!
   
   I have worked with people who believe mocks should be as close to the 
behaviour of the "real deal" as possible (and am partial to this opinion 
myself), but I'll maybe open another PR with that, as I think that is more of a 
stylistic opinion (whether Apache has this codified somewhere, I don't know), 
and I'd really like to improve the seek documentation, as I spent quite a few 
hours googling for this stuff. 
   
   For now, I've moved the tests to the Plaintext Consumer, and added tests for 
the various auto.offset.reset configs. The behaviours in latest seem super 
weird to me, based on your explanation - they don't seem to match 
https://medium.com/lydtech-consulting/kafka-consumer-auto-offset-reset-d3962bad2665
 specifically for the `latest` value. 
   
   In the case of `latest`, if the next batch of records contains the offset 
that is passed to seek, it seems to skip to that offset, which is the same 
behaviour that the mock consumer had, which kind of makes sense. However, if 
the next batch of records doesn't contain the offset last passed to seek, it 
resets to the very beginning (offset 0). Either I am missing something, or this 
might be a bug?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to