Fix tSafe replica unit test (#12325)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/12329/head
bigsheeper 2021-11-29 14:17:17 +08:00 committed by GitHub
parent 8cd1fccfb1
commit cad61ea47e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,6 @@ package querynode
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
@ -29,7 +28,7 @@ func TestTSafeReplica_valid(t *testing.T) {
timestamp := Timestamp(1000)
err = replica.setTSafe(defaultVChannel, defaultCollectionID, timestamp)
assert.NoError(t, err)
time.Sleep(20 * time.Millisecond)
<-watcher.watcherChan()
resT, err := replica.getTSafe(defaultVChannel)
assert.NoError(t, err)
assert.Equal(t, timestamp, resT)
@ -49,7 +48,7 @@ func TestTSafeReplica_invalid(t *testing.T) {
timestamp := Timestamp(1000)
err = replica.setTSafe(defaultVChannel, defaultCollectionID, timestamp)
assert.NoError(t, err)
time.Sleep(20 * time.Millisecond)
<-watcher.watcherChan()
resT, err := replica.getTSafe(defaultVChannel)
assert.NoError(t, err)
assert.Equal(t, timestamp, resT)