Skip to content

Commit

Permalink
Update unit test to use up to 5 in-flight requests
Browse files Browse the repository at this point in the history
  • Loading branch information
slaunay committed Feb 9, 2022
1 parent 6c70a6c commit 8f92872
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions async_producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,12 @@ func TestAsyncProducerMultipleRetriesWithConcurrentRequests(t *testing.T) {
config := NewTestConfig()
// Use very short read to simulate read error on unresponsive broker
config.Net.ReadTimeout = 50 * time.Millisecond
// Flush every record to generate N in-flight Produce requests
config.Producer.Flush.Messages = 1
// Flush every record to generate up to 5 in-flight Produce requests
// because config.Net.MaxOpenRequests defaults to 5
config.Producer.Flush.MaxMessages = 1
config.Producer.Return.Successes = true
// Reduce retries to speed up the test while keeping the default backoff
config.Producer.Retry.Max = 1
config.Net.MaxOpenRequests = 1
producer, err := NewAsyncProducer([]string{seedBroker.Addr()}, config)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 8f92872

Please sign in to comment.