提交 0afeaa78 编写于 作者: N neza2017 提交者: yefu.chen

Fix unittest of flow graph

Signed-off-by: Nneza2017 <yefu.chen@zilliz.com>
上级 5d586063
......@@ -5,7 +5,6 @@ import (
"fmt"
"log"
"math"
"math/big"
"math/rand"
"sync"
"testing"
......@@ -139,9 +138,15 @@ func sendMsgFromCmd(ctx context.Context, fg *TimeTickedFlowGraph) {
}
// assert result
expect := math.Pow(num, 2) + math.Sqrt(num)
if big.NewFloat(res) != big.NewFloat(expect) {
fmt.Println(res)
fmt.Println(math.Pow(num, 2) + math.Sqrt(num))
resBits := math.Float64bits(res)
expBits := math.Float64bits(expect)
var diffBits uint64
if resBits >= expBits {
diffBits = resBits - expBits
} else {
diffBits = expBits - resBits
}
if diffBits > 2 {
panic("wrong answer")
}
}
......
......@@ -13,5 +13,5 @@ SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# ignore Minio,S3 unittes
MILVUS_DIR="${SCRIPTS_DIR}/../internal/"
echo $MILVUS_DIR
go test -cover "${MILVUS_DIR}/kv/..." "${MILVUS_DIR}/msgstream/..." "${MILVUS_DIR}/master/..." "${MILVUS_DIR}/querynode/..." "${MILVUS_DIR}/storage" "${MILVUS_DIR}/proxy/..." "${MILVUS_DIR}/writenode/..." -failfast
go test -cover "${MILVUS_DIR}/kv/..." "${MILVUS_DIR}/msgstream/..." "${MILVUS_DIR}/master/..." "${MILVUS_DIR}/querynode/..." "${MILVUS_DIR}/storage" "${MILVUS_DIR}/proxy/..." "${MILVUS_DIR}/writenode/..." "${MILVUS_DIR}/util/..." -failfast
#go test -cover "${MILVUS_DIR}/kv/..." "${MILVUS_DIR}/msgstream/..." "${MILVUS_DIR}/master/..." "${MILVUS_DIR}/querynode/..." -failfast
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册