Skip to content

KAFKA-19091: Fix race condition in DelayedFutureTest #19553

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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

UladzislauBlok
Copy link

The root case of flakiness is race condition between worker thread (thread which is executing the test) and executor-testDelayedFuture (thread which should execute callback).

It was fixed with TestUtils#waitForCondition to wait until callback will be done

Test evidence:

Test was running 1000 times with repeated test.

Results:
~/p/kafka (bloku/kafka-19091) [1]> ./gradlew server:test --tests DelayedFutureTest --fail-fast > res.txt
~/p/kafka (bloku/kafka-19091)> grep FAILED res.txt
~/p/kafka (bloku/kafka-19091) [1]>

res.txt:
> Task :server:test

Gradle Test Run :server:test > Gradle Test Executor 14 > DelayedFutureTest > testDelayedFuture() > repetition 1 of 1000 PASSED

...

BUILD SUCCESSFUL in 37m

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) small Small PRs labels Apr 24, 2025
@UladzislauBlok
Copy link
Author

One question from me.
Why this is one test with four test cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Kafka Broker small Small PRs tests Test fixes (including flaky tests) triage PRs from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant