Skip to content

Commit

Permalink
Remove logging
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Feb 5, 2025
1 parent bbadeee commit 4b0e59e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2271,24 +2271,23 @@ func TestAckShouldNotCloseChannel_GH296(t *testing.T) {
t.Fatalf("Consume error: %v", err)
}

signal := make(chan bool)
signal := make(chan int)
acks := make(chan *Delivery, messageCount)

go func() {
counter := 0
for ;; {
select {
case msg := <-msgs:
t.Logf("starting worker for message: %d", msg.DeliveryTag)
go worker(t, acks, &msg)
go worker(acks, &msg)
case ack := <-acks:
ackError := ack.Ack(false)
if ackError != nil {
t.Logf("Ack error: %v", ackError)
}
counter = counter + 1
if counter >= messageCount {
signal <- true
signal <- counter
return
}
case <-time.After(500 * time.Millisecond):
Expand All @@ -2302,18 +2301,16 @@ func TestAckShouldNotCloseChannel_GH296(t *testing.T) {
t.Logf("saw connection closure error: %v", connError)
case channelError := <-notifyChannelClosed:
t.Logf("saw channel closure error: %v", channelError)
case <-signal:
t.Logf("saw %d messages", messageCount)
case count := <-signal:
t.Logf("saw %d messages", count)
case <-time.After(5 * time.Second):
t.Fatalf("timed out waiting to see %d messages", messageCount)
}
}

func worker(t *testing.T, acks chan<- *Delivery, msg *Delivery) {
t.Logf("worker processing message: %d", msg.DeliveryTag)
func worker(acks chan<- *Delivery, msg *Delivery) {
time.Sleep(time.Millisecond * time.Duration(msg.DeliveryTag) * 100)
acks <- msg
t.Logf("worker done processing message: %d", msg.DeliveryTag)
}

/*
Expand Down

0 comments on commit 4b0e59e

Please sign in to comment.