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

Fix unittest of flow graph

Signed-off-by: Nneza2017 <yefu.chen@zilliz.com>
上级 5d586063
...@@ -5,7 +5,6 @@ import ( ...@@ -5,7 +5,6 @@ import (
"fmt" "fmt"
"log" "log"
"math" "math"
"math/big"
"math/rand" "math/rand"
"sync" "sync"
"testing" "testing"
...@@ -139,9 +138,15 @@ func sendMsgFromCmd(ctx context.Context, fg *TimeTickedFlowGraph) { ...@@ -139,9 +138,15 @@ func sendMsgFromCmd(ctx context.Context, fg *TimeTickedFlowGraph) {
} }
// assert result // assert result
expect := math.Pow(num, 2) + math.Sqrt(num) expect := math.Pow(num, 2) + math.Sqrt(num)
if big.NewFloat(res) != big.NewFloat(expect) { resBits := math.Float64bits(res)
fmt.Println(res) expBits := math.Float64bits(expect)
fmt.Println(math.Pow(num, 2) + math.Sqrt(num)) var diffBits uint64
if resBits >= expBits {
diffBits = resBits - expBits
} else {
diffBits = expBits - resBits
}
if diffBits > 2 {
panic("wrong answer") panic("wrong answer")
} }
} }
......
...@@ -13,5 +13,5 @@ SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" ...@@ -13,5 +13,5 @@ SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# ignore Minio,S3 unittes # ignore Minio,S3 unittes
MILVUS_DIR="${SCRIPTS_DIR}/../internal/" MILVUS_DIR="${SCRIPTS_DIR}/../internal/"
echo $MILVUS_DIR 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 #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.
先完成此消息的编辑!
想要评论请 注册