mirror of https://github.com/milvus-io/milvus.git
Add ruleguard and open ruleguard check
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>pull/4973/head^2
parent
b68322d469
commit
cfee642a11
6
Makefile
6
Makefile
|
@ -42,9 +42,9 @@ lint:
|
|||
|
||||
ruleguard:
|
||||
@echo "Running $@ check"
|
||||
@${GOPATH}/bin/ruleguard -rules ruleguard.rules.go ./internal/... || true
|
||||
@${GOPATH}/bin/ruleguard -rules ruleguard.rules.go ./cmd/... || true
|
||||
@${GOPATH}/bin/ruleguard -rules ruleguard.rules.go ./test/... || true
|
||||
@${GOPATH}/bin/ruleguard -rules ruleguard.rules.go ./internal/...
|
||||
@${GOPATH}/bin/ruleguard -rules ruleguard.rules.go ./cmd/...
|
||||
@${GOPATH}/bin/ruleguard -rules ruleguard.rules.go ./test/...
|
||||
|
||||
verifiers: get-check-deps fmt lint ruleguard
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ func (gta *GlobalTSOAllocator) GenerateTSO(count uint32) (uint64, error) {
|
|||
|
||||
for i := 0; i < maxRetryCount; i++ {
|
||||
current := (*atomicObject)(atomic.LoadPointer(>a.tso.TSO))
|
||||
if current == nil || current.physical == typeutil.ZeroTime {
|
||||
if current == nil || current.physical.Equal(typeutil.ZeroTime) {
|
||||
// If it's leader, maybe SyncTimestamp hasn't completed yet
|
||||
log.Println("sync hasn't completed yet, wait for a while")
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
|
|
|
@ -35,7 +35,7 @@ func TestGlobalTSOAllocator_GenerateTSO(t *testing.T) {
|
|||
for i := 0; i < count; i++ {
|
||||
ts, _ := GTsoAllocator.GenerateTSO(perCount)
|
||||
physical, logical := tsoutil.ParseTS(ts)
|
||||
if lastPhysical == physical {
|
||||
if lastPhysical.Equal(physical) {
|
||||
diff := logical - lastLogical
|
||||
assert.Equal(t, uint64(perCount), diff)
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ func TestTimeTick(t *testing.T) {
|
|||
return
|
||||
}
|
||||
if tsm.Timestamp <= lastTimestamp {
|
||||
t.Fatalf("current = %d, last = %d", uint64(tsm.Timestamp), uint64(lastTimestamp))
|
||||
t.Fatalf("current = %d, last = %d", tsm.Timestamp, lastTimestamp)
|
||||
}
|
||||
t.Log("current = ", tsm.Timestamp)
|
||||
lastTimestamp = tsm.Timestamp
|
||||
|
|
|
@ -137,7 +137,7 @@ func sendMsgFromCmd(ctx context.Context, fg *TimeTickedFlowGraph) {
|
|||
return
|
||||
}
|
||||
// assert result
|
||||
if res != math.Pow(num, 2)+math.Sqrt(num) {
|
||||
if res-(math.Pow(num, 2)+math.Sqrt(num)) > 0.000001 {
|
||||
fmt.Println(res)
|
||||
fmt.Println(math.Pow(num, 2) + math.Sqrt(num))
|
||||
panic("wrong answer")
|
||||
|
|
Loading…
Reference in New Issue