Skip to content

Commit

Permalink
Merge pull request #451 from moonpolysoft/fix-deadlock-in-consumer-mock
Browse files Browse the repository at this point in the history
fix a deadlock in the consumer mock
  • Loading branch information
frairon authored Apr 28, 2024
2 parents 3c728ec + fdd1ae5 commit d8004e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mockautoconsumers.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ func (pc *MockAutoPartitionConsumer) Close() error {
pc.t.Errorf("Expected the messages channel for %s/%d to be drained on close, but found %d messages.", pc.topic, pc.partition, len(pc.messages))
}

pc.AsyncClose()
close(pc.messages)
close(pc.errors)
pc.consumed = false

var (
closeErr error
Expand Down

0 comments on commit d8004e7

Please sign in to comment.