Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to work on #311 but I could not reliably get the tests to pass, so I have changed the test suite so that each test uses a unique topic. Each test now has a pristine topic to work with, removing the risk for pollution from previous runs and obviates fiddling offsets. This is one of many ways you can organize such test infrastructure. I'm not wedded to this exact shape; it was simply the version I could come up with that produced the most readable diff.
Additionally, the schema tests wanted to ensure that unknown subjects resulted in panic, but seems to use a subject that is also used for test that verifies positive function. The PR changes those tests to use a subject not used for other things.
Finally, a number of readers were created in one "assert closure" but was then used inside another. This works, but is iffy, particularly when the first closure does
defer reader.Close()
. I think there were intermittent failures as a result of this placement, but I never managed to figure out exactly why they failed. Regardless, the PR moves the creation of those readers outside their closure for more readable code. I have not managed to get the same failures with this flow.