Skip to content

Commit

Permalink
fix test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
HDT3213 committed Sep 27, 2024
1 parent a752279 commit 7354e38
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,15 @@ func TestMonitor_listener1(t *testing.T) {
t.Error(err)
}
}
queue.beforeConsume()
ids, err := queue.beforeConsume()
if err != nil {
t.Errorf("consume error: %v", err)
return
}
for _, id := range ids {
queue.callback(id)
}
queue.afterConsume()

if profile.ProduceCount != size {
t.Error("wrong produce count")
Expand Down Expand Up @@ -151,7 +159,15 @@ func TestMonitor_listener2(t *testing.T) {
}
}
for i := 0; i < 3; i++ {
queue.beforeConsume()
ids, err := queue.beforeConsume()
if err != nil {
t.Errorf("consume error: %v", err)
return
}
for _, id := range ids {
queue.callback(id)
}
queue.afterConsume()
}

if profile.RetryCount != size {
Expand Down

0 comments on commit 7354e38

Please sign in to comment.