Skip to content

KAFKA-20329: Test headers dsl.store.format further (3/N)#21820

Open
aliehsaeedii wants to merge 4 commits intoapache:trunkfrom
aliehsaeedii:dsl_headers_testing_3
Open

KAFKA-20329: Test headers dsl.store.format further (3/N)#21820
aliehsaeedii wants to merge 4 commits intoapache:trunkfrom
aliehsaeedii:dsl_headers_testing_3

Conversation

@aliehsaeedii
Copy link
Copy Markdown
Contributor

@aliehsaeedii aliehsaeedii commented Mar 19, 2026

This PR parametrizes 10 integration test classes (49 test methods total)
to ensure comprehensive testing coverage for both default and
header-based DSL store formats. Each test now runs twice: once with
the default store format and once with dsl.store.format=headers.

Reviewers: TengYao Chi frankvicky@apache.org

@github-actions github-actions bot added triage PRs from the community streams tests Test fixes (including flaky tests) labels Mar 19, 2026
@mjsax mjsax added kip Requires or implements a KIP ci-approved and removed triage PRs from the community labels Mar 20, 2026
Copy link
Copy Markdown
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

Comment on lines +143 to +145
if (withHeaders) {
streamsConfiguration.put(StreamsConfig.DSL_STORE_FORMAT_CONFIG, StreamsConfig.DSL_STORE_FORMAT_HEADERS);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a withHeader parameter to startStreams() for reducing the repeat code ?

Copy link
Copy Markdown
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't express clear.
There're tons of if conditions for headers config in test files.
If we repeat it several times, we should add a helper method to reduce boilerplate code.

}

private void configureStreams(final boolean streamsProtocolEnabled, final String appID) {
private void configureStreams(final boolean withHeaders, final String appID) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we remove streamsProtocolEnabled ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:O

@ParameterizedTest
@ValueSource(booleans = {true, false})
public void shouldAddMetricsOnAllLevels(final boolean streamsProtocolEnabled) throws Exception {
if (streamsProtocolEnabled) {
Copy link
Copy Markdown
Member

@mjsax mjsax Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question? Also below.

);
createStateForRestoration(inputStream, 0);

final boolean useNewProtocol = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot follow -- also, if we don't want to test "streams" protocol any longer, why do we needs this constant at all?


sendEvents(inputTopic, sampleData);

final boolean useNewProtocol = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar.

Copy link
Copy Markdown
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aliehsaeedii thanks for enhancing the tests!

mkEntry(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getPath())
));
if (withHeaders) {
props.put(StreamsConfig.DSL_STORE_FORMAT_CONFIG, StreamsConfig.DSL_STORE_FORMAT_HEADERS);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The helper method maybeSetDslStoreFormatHeaders is so beautiful. We should let other classes be obsessed with it too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Copy Markdown
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM

mkEntry(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getPath())
));
if (withHeaders) {
props.put(StreamsConfig.DSL_STORE_FORMAT_CONFIG, StreamsConfig.DSL_STORE_FORMAT_HEADERS);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@frankvicky
Copy link
Copy Markdown
Contributor

retrigger CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved kip Requires or implements a KIP streams tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants