Skip to content

Commit

Permalink
Reduce backoff time in TestReaderHasNextRetryFailed
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertIndie committed Feb 26, 2024
1 parent 27f1523 commit db32e43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pulsar/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1049,15 +1049,15 @@ func TestReaderHasNextRetryFailed(t *testing.T) {
r, err := client.CreateReader(ReaderOptions{
Topic: topic,
StartMessageID: EarliestMessageID(),
// Retry the connection 10 seconds after it's disconnected.
BackoffPolicy: newTestBackoffPolicy(10*time.Second, 10*time.Second),
// Retry the connection 1 second after it's disconnected.
BackoffPolicy: newTestBackoffPolicy(1*time.Second, 1*time.Second),
})
assert.Nil(t, err)

// Disconnect the connection
r.(*reader).c.consumers[0].conn.Load().(internal.Connection).Close()
minTimer := time.NewTimer(10 * time.Second) // Timer to check if r.HasNext() blocked for at least 10s
maxTimer := time.NewTimer(20 * time.Second) // Timer to ensure r.HasNext() doesn't block for more than 20s
minTimer := time.NewTimer(1 * time.Second) // Timer to check if r.HasNext() blocked for at least 1s
maxTimer := time.NewTimer(2 * time.Second) // Timer to ensure r.HasNext() doesn't block for more than 2s

done := make(chan bool)
go func() {
Expand Down

0 comments on commit db32e43

Please sign in to comment.