milvus/internal/util/errorutil/util_test.go
Enwei Jiao 697dedac7e
Use cockroachdb/errors to replace other error pkg (#22390)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
2023-02-26 11:31:49 +08:00

30 lines
558 B
Go

package errorutil
import (
"testing"
"github.com/cockroachdb/errors"
"github.com/milvus-io/milvus/internal/log"
"go.uber.org/zap"
)
func TestErrorList_Error(t *testing.T) {
var el ErrorList
for i := 0; i < 5; i++ {
el = append(el, errors.New("error occur"))
}
for i := 0; i < 5; i++ {
el = append(el, nil)
}
log.Debug("all errors are", zap.Error(el))
}
func TestErrorList_Error_Limit(t *testing.T) {
var el ErrorList
for i := 0; i < 15; i++ {
el = append(el, errors.New("error occur"))
}
log.Debug("all errors are", zap.Error(el))
}