Skip to content

KAFKA-19511: Fix flaky test HandlingSourceTopicDeletionIntegrationTest.shouldThrowErrorAfterSourceTopicDeleted#20183

Closed
RaidenE1 wants to merge 2 commits intoapache:trunkfrom
RaidenE1:feat/longer_timeout_in_test
Closed

KAFKA-19511: Fix flaky test HandlingSourceTopicDeletionIntegrationTest.shouldThrowErrorAfterSourceTopicDeleted#20183
RaidenE1 wants to merge 2 commits intoapache:trunkfrom
RaidenE1:feat/longer_timeout_in_test

Conversation

@RaidenE1
Copy link
Copy Markdown
Contributor

@RaidenE1 RaidenE1 commented Jul 16, 2025

Ticket here: https://issues.apache.org/jira/browse/KAFKA-19511

Original timeout for HandlingSourceTopicDeletionIntegrationTest is 60s
which is not enough. Sometimes the state of Kafka streams thread needs
around 100s to change the state from PENDING ERROR to ERROR, as it still
try to poll data while the source topic is missing, also while leaving
the consumer group it will reach the timeout for 30s.

@github-actions github-actions Bot added streams tests Test fixes (including flaky tests) triage PRs from the community small Small PRs labels Jul 16, 2025
@mjsax mjsax added ci-approved and removed triage PRs from the community labels Jul 16, 2025
@mjsax
Copy link
Copy Markdown
Member

mjsax commented Jul 16, 2025

Thanks for the PR. I am not sure if I fully understand. I believe this issue with this test was introduced when streams protocol was added. But why does it modify the behavior in the way you describe?

What you describe sounds very generic and I am wondering why it was not a problem for classic protocol?

Btw: Looking into the test, it seems we are leaking KafkaStreams() instances, as we don't close() them. Can we extend this PR to use try-with-resource to ensure we don't leak instances?

Another minor fix could be, to replace Serdes.Integer().getClass() in the config setup with Serdes.IntegerSerde.class.

@RaidenE1
Copy link
Copy Markdown
Contributor Author

RaidenE1 commented Jul 17, 2025

@mjsax Yeah, it only happens in the new protocol, I've run it for a hundred times maybe, old protocols are all good, half of the new test spend 100s and failed the original test since it's set to 60s.

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

Labels

ci-approved small Small PRs streams tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants