mirror of https://github.com/milvus-io/milvus.git
Fix unittest of flow graph
Signed-off-by: neza2017 <yefu.chen@zilliz.com>pull/4973/head^2
parent
5d58606349
commit
0afeaa78c8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue