Skip to content

Commit

Permalink
Fix TestBatchMessageIDWithAckTracker
Browse files Browse the repository at this point in the history
  • Loading branch information
BewareMyPower committed Nov 21, 2024
1 parent 1c39b66 commit 5f0e32d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pulsar/consumer_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package pulsar
import (
"sync"
"testing"
"time"

"github.com/apache/pulsar-client-go/pulsar/internal"
"github.com/apache/pulsar-client-go/pulsar/internal/crypto"
Expand Down Expand Up @@ -121,14 +122,18 @@ func TestBatchMessageIDWithAckTracker(t *testing.T) {

// ensure the tracker was set on the message id
var messageIDs []*trackingMessageID
for i := 0; i < 10; i++ {
running := true
for running {
select {
case m := <-pc.queueCh.outCh:
id := m.ID().(*trackingMessageID)
assert.NotNil(t, id.tracker)
messageIDs = append(messageIDs, id)
default:
break
if len(messageIDs) == 10 {
running = false
}
case <-time.After(5 * time.Second):
running = false
}
}

Expand Down

0 comments on commit 5f0e32d

Please sign in to comment.