-
Notifications
You must be signed in to change notification settings - Fork 1k
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
test: do not mock config store in StandaloneExecutor integration test #4128
test: do not mock config store in StandaloneExecutor integration test #4128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
thanks for the patch @vcrfxia . Can we backport this to 5.4 too? |
47fba1f
to
83e7dd8
Compare
Retargeted the patch at |
@vcrfxia since we're using an actual KafkaConfigStore, Probably just need to specify that config to |
Why backport? It's a test only change. It's not as though someone is going to change how the config topic code works in 5.4.... |
Is it worth removing any other mocks in this integration test while we're at it? They may open us to the same hole in testing in the future... |
The only other mock in this integration test is the version checker. Not sure what we'd replace that mock with, and it's also mocked in our other integration tests. |
Because backporting the test fix has caught a bug! Turns out headless mode is broken on 5.4 for the reason the Jenkins build failed:
|
The fix is to update the legacy values for the sink number of partitions and replicas configs to |
Actually, this is a bit of an odd fix since the intention of the legacy config values being non-null was so that existing queries issued prior to 5.3 (when the sink number of partitions and replicas were deprecated) will continue to validate the way they had been. I think this change is still sound since the new behavior (when the values are null) is to use existing values for number of partitions and replicas, and topics for existing queries exist by definition. However, maybe it's safer to limit this change to only set |
Talked to @rodesai who pointed out the fix of updating the legacy config values to |
If I am reading this correctly, we are saying that if a user ran this in interactive mode pre 5.3, they would have their old values in the command topic, so the new defaults won't matter to them? |
Did we do a manual test of non-interactive mode with different input topic configs in 5.4 as well? |
That's actually not what I meant, but that's also true and another good reason this change is safe. I meant that for 5.4 in interactive mode, we only validate number of partitions and replicas at the time a command is received (i.e., before writing the command to the command topic) and not when replaying commands from the command topic as part of restarting the server, which means the default legacy values for the |
Yup, assuming this means verifying that the KSQL server starts in non-interactive mode on 5.4 with this fix, if topics have properties other than 4 partitions and 1 replica. I also manually verified that an upgrade from KSQL 5.2 to 5.4 in interactive mode works as expected, with topics that have properties other than 4 partitions and 1 replica. |
Description
As described in #4114, the ksqlDB server from the latest release fails to start in headless mode. This bug eluded our integration tests for headless mode because the integration test currently mocks the KafkaConfigStore which updates the KSQL config passed to the StandaloneExecutor (the mock does not perform these updates). This PR switches the integration test to use an actual KafkaConfigStore instance, rather than a mock, to avoid similar bugs in the future.
Testing done
Test-only change.
Reviewer checklist