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 flaky KafkaConsumer#assignmentStream tests #1274

Merged

Conversation

aartigao
Copy link
Contributor

There's no need to consume a topic's records in order to test the partition assignments.

This causes a race condition where, if consumer.records occurs first, the initial expected empty assignment is not streamed 👇🏽 (see the missing first TreeSet()):

[info] - should stream assignment updates to listeners *** FAILED *** (10 seconds, 632 milliseconds)
[info]   List(TreeSet(topic-2b357246-81b5-460d-ba2e-822ed148e635-0, topic-2b357246-81b5-460d-ba2e-822ed148e635-1, topic-2b357246-81b5-460d-ba2e-822ed148e635-2), TreeSet(), TreeSet(topic-2b357246-81b5-460d-ba2e-822ed148e635-0, topic-2b357246-81b5-460d-ba2e-822ed148e635-1)) had length 3 instead of expected length 4 (KafkaConsumerSpec.scala:803)

@aartigao aartigao merged commit 7a02429 into fd4s:series/3.x Nov 17, 2023
8 checks passed
@aartigao aartigao deleted the fix-flaky-assignment-stream-tests branch November 17, 2023 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant