Skip to content
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

fix(test): improve flakey async producer test #1935

Merged
merged 1 commit into from
May 5, 2021

Conversation

dnwe
Copy link
Collaborator

@dnwe dnwe commented May 5, 2021

The TestAsyncProducerRecoveryWithRetriesDisabled periodically fails and
then passes on a re-run. Stepping through it I believe this was because
the test had assumed metadata requests would always go to the
seed/bootstrap broker, but they can actually go to any broker. So there
was a 1 in 3 chance that the test would fail because it would await
timeout of metadata requests that were never going to be responded to.

Rewriting the test to use the handler map capability rather than the
expectations interface and configuring the mock metadata responses on
all mock brokers allows the test to pass quickly and reliably.

The TestAsyncProducerRecoveryWithRetriesDisabled periodically fails and
then passes on a re-run. Stepping through it I believe this was because
the test had assumed metadata requests would always go to the
seed/bootstrap broker, but they can actually go to any broker. So there
was a 1 in 3 chance that the test would fail because it would await
timeout of metadata requests that were never going to be responded to.

Rewriting the test to use the handler map capability rather than the
expectations interface and configuring the mock metadata responses on
all mock brokers allows the test to pass quickly and reliably.
@dnwe dnwe requested a review from bai as a code owner May 5, 2021 15:12
@dnwe dnwe merged commit 9d205e2 into master May 5, 2021
@dnwe dnwe deleted the ref/heads/dnwe/improve-test branch May 5, 2021 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant