Skip to content

KAFKA-19216: Eliminate flakiness in kafka.server.share.SharePartitionTest #19639

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

Merged
merged 2 commits into from
May 5, 2025

Conversation

adixitconfluent
Copy link
Contributor

@adixitconfluent adixitconfluent commented May 5, 2025

About

11 of the test cases in SharePartitionTest have failed at least once
in the past 28 days.
https://develocity.apache.org/scans/tests?search.relativeStartTime=P28D&search.rootProjectNames=kafka&search.timeZoneId=Europe%2FLondon&tests.container=kafka.server.share.SharePartitionTest
Observing the flakiness, they seem to be caused due to the usage of
SystemTimer for various acquisition lock timeout related tests. I have
replaced the usage of SystemTimer with MockTimer and also improved
the MockTimer API with regard to removing the timer task entries that
have already been cancelled.
Also, this has reduced the time taken to run SharePartitionTest from
~6 sec to ~1.5 sec

Testing

The testing has been done with the help of already present unit tests in
Apache Kafka.

Reviewers: Andrew Schofield [email protected]

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) KIP-932 Queues for Kafka small Small PRs labels May 5, 2025
@AndrewJSchofield AndrewJSchofield removed the triage PRs from the community label May 5, 2025
@AndrewJSchofield AndrewJSchofield merged commit caf4a6c into apache:trunk May 5, 2025
27 checks passed
shmily7829 pushed a commit to shmily7829/kafka that referenced this pull request May 7, 2025
…Test (apache#19639)

### About
11 of the test cases in `SharePartitionTest` have failed at least once
in the past 28 days.

https://develocity.apache.org/scans/tests?search.relativeStartTime=P28D&search.rootProjectNames=kafka&search.timeZoneId=Europe%2FLondon&tests.container=kafka.server.share.SharePartitionTest
Observing the flakiness, they seem to be caused due to the usage of
`SystemTimer` for various acquisition lock timeout related tests. I have
replaced the usage of `SystemTimer` with `MockTimer` and also improved
the `MockTimer` API with regard to removing the timer task entries that
have already been cancelled.
Also, this has reduced the time taken to run `SharePartitionTest` from
~6 sec to ~1.5 sec

### Testing
The testing has been done with the help of already present unit tests in
Apache Kafka.

Reviewers: Andrew Schofield <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved core Kafka Broker KIP-932 Queues for Kafka small Small PRs tests Test fixes (including flaky tests)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants