Skip to content
Snippets Groups Projects
Commit 0afeaa78 authored by neza2017's avatar neza2017 Committed by yefu.chen
Browse files

Fix unittest of flow graph


Signed-off-by: default avatarneza2017 <yefu.chen@zilliz.com>
parent 5d586063
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment