From 7354e38ce9beaa9932c5023595d1860b59384c67 Mon Sep 17 00:00:00 2001 From: finley Date: Fri, 27 Sep 2024 21:43:55 +0800 Subject: [PATCH] fix test suite --- monitor_test.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/monitor_test.go b/monitor_test.go index aae0e61..445fc01 100644 --- a/monitor_test.go +++ b/monitor_test.go @@ -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") @@ -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 {