milvus/internal/querynode/tsafe_test.go
bigsheeper f02bd8c8f5 Rename query node package, implement watchDmChannel
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2021-01-16 10:12:14 +08:00

22 lines
355 B
Go

package querynode
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestTSafe_GetAndSet(t *testing.T) {
tSafe := newTSafe()
watcher := newTSafeWatcher()
tSafe.registerTSafeWatcher(watcher)
go func() {
watcher.hasUpdate()
timestamp := tSafe.get()
assert.Equal(t, timestamp, Timestamp(1000))
}()
tSafe.set(Timestamp(1000))
}