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): consumer group fetch request messages #3081

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

stsmurf
Copy link
Contributor

@stsmurf stsmurf commented Jan 16, 2025

There is a bug in the tests with

NewMockSequence(
    NewMockFetchResponse(t, 1).
        SetMessage("my-topic", 0, 0, StringEncoder("foo")).
        SetMessage("my-topic", 0, 1, StringEncoder("bar")),
    NewMockFetchResponse(t, 1),
)

This sets the message on the first NewMockFetchResponse twice and does not set the message on the second response. This was covered up in the test because of the break in the for loop over claim.Messages(). The update now passes the messages through a channel back to the test for assertion.

In addition, the context.WithCancel was not having any affect on the test. Closing the group causes the context to be Done. This is verified by utilizing the same channel.

Copy link
Collaborator

@dnwe dnwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Good spot

@dnwe dnwe added the tests label Jan 17, 2025
@dnwe dnwe merged commit 54ceae4 into IBM:main Jan 17, 2025
1 check passed
@stsmurf stsmurf deleted the stsmurf/consumer-group-example branch January 17, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants