mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
32445dd02b
Signed-off-by: neza2017 <yefu.chen@zilliz.com>
22 lines
364 B
Go
22 lines
364 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))
|
|
}
|