mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
Related to #39095 https://go.dev/doc/modules/version-numbers Update pkg version according to golang dep version convention --------- Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
31 lines
703 B
Go
31 lines
703 B
Go
package msgdispatcher
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"go.uber.org/zap"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
|
|
"github.com/milvus-io/milvus/pkg/v2/log"
|
|
"github.com/milvus-io/milvus/pkg/v2/mq/msgstream"
|
|
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
|
|
)
|
|
|
|
func TestSendTimeout(t *testing.T) {
|
|
target := newTarget("test1", &msgpb.MsgPosition{}, nil)
|
|
|
|
time.Sleep(paramtable.Get().MQCfg.MaxTolerantLag.GetAsDuration(time.Second))
|
|
|
|
counter := 0
|
|
for i := 0; i < 10; i++ {
|
|
err := target.send(&msgstream.MsgPack{})
|
|
if err != nil {
|
|
log.Error("send failed", zap.Int("idx", i), zap.Error(err))
|
|
counter++
|
|
}
|
|
}
|
|
assert.Equal(t, counter, 0)
|
|
}
|