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

[WIP] [Rhythm] Block builder test updates #4510

Open
wants to merge 5 commits into
base: main-rhythm
Choose a base branch
from

Conversation

mdisibio
Copy link
Contributor

@mdisibio mdisibio commented Jan 3, 2025

What this PR does:
This updates the block builder tests and fake kafka cluster setup to be closer to real kafka, and less specific to the current block builder implementation. The goal is to make the tests more general and stable against future block builder changes.

Changes:

  • Verify last committed offset
  • Eliminate the 2 modes, with and without consumer groups. Now it is always with consumer groups.
  • Instead of using kfake directly, wrap with another struct...
  • ... to allow multiple OffsetCommit callbacks with deterministic call order (so we can customize for each test but still support consumer groups)

Why does this need to change:
To support consumer groups, we use custom callback via ControlKey(OffsetCommit,...). And another one for tests like _committingFails to simulate a commit failure. However kfake stores these callbacks in a map and cannot guarantee their execution order. Therefore the only way to reliably test is combine all with one callback. Using the wrapper struct is overall easier than the alternative plumbing in the previous setup.

Related: #4480

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant