KAFKA-19983: Fix MockProcessorContext doesn't work with WindowStores.#21677
KAFKA-19983: Fix MockProcessorContext doesn't work with WindowStores.#21677chickenchickenlove wants to merge 1 commit intoapache:trunkfrom
Conversation
|
@mjsax I opened a draft PR and wanted to use it as a starting point for discussion. #1 Because of the changes introduced in #16906, a path that previously appears to have worked with only "This component requires internal features of Kafka Streams and must be disabled for unit tests." However, this path seems to have been testable before, so I think there is a reasonable argument that this should be considered a regression. also, this direction is aligned with what #2 With that approach, we could implement only the However, in that case, At the moment, the draft PR is based on option #1, but I would really appreciate your thoughts on which direction would be more appropriate! Thanks for taking the time to look at this. 🙇♂️ |
|
@mjsax Thanks for addressing this regression! I have many services that use MockProcessorContext for unit tests. It’s very useful because I only need to test the processor logic itself, rather than setting up a full TopologyTestDriver. However, due to this regression, many of my tests are now failing. I have two questions:
For example, I currently have the following setup for my tests: and using MockProcessorContext for scheduling Punctuator and capturing forwarded record, e.g.: |
|
Just hitting the same issue on #21684 -- The PR goes the route of proposal (2) on this to, to change add I was not aware of this PR until I cycled back to the Jira ticket... My PR does not fully address the ticket though I believe? So we would still need this PR to complete it, and also remove all code which becomes unnecessary as we can always cast to |
Description
After Kafka 4.0.0,
MockProcessorContextdoesn't work with WindowStores.This is a regression caused by #16906.
Some
StateStores accept aStateStoreContext, but internally require anInternalProcessorContext.Because of this, tests using
MockProcessorContextno longer work with non-logging, non-cachingWindowStores.This PR is draft based on my current understanding of the problem and one possible direction for fixing it.
I would like to use this PR as a starting point for discussion and align on the right approach with the community.