mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
Add sync logic in TestWatchChannel (#7188)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
9e71daa759
commit
881d0af1fc
@ -340,6 +340,7 @@ func TestWatchChannel(t *testing.T) {
|
||||
c := make(chan struct{})
|
||||
go func() {
|
||||
ec := kv.WatchWithPrefix(fmt.Sprintf("channel/%d", node.NodeID))
|
||||
c <- struct{}{}
|
||||
cnt := 0
|
||||
for {
|
||||
evt := <-ec
|
||||
@ -354,6 +355,8 @@ func TestWatchChannel(t *testing.T) {
|
||||
}
|
||||
c <- struct{}{}
|
||||
}()
|
||||
// wait for check goroutine start Watch
|
||||
<-c
|
||||
|
||||
vchan := &datapb.VchannelInfo{
|
||||
CollectionID: 1,
|
||||
@ -369,6 +372,7 @@ func TestWatchChannel(t *testing.T) {
|
||||
err = kv.Save(path, string(val))
|
||||
assert.Nil(t, err)
|
||||
|
||||
// wait for check goroutine received 2 events
|
||||
<-c
|
||||
node.chanMut.RLock()
|
||||
_, has := node.vchan2SyncService[ch]
|
||||
|
Loading…
Reference in New Issue
Block a user