mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix data race in datacoord test (#9936)
issue: #9935 Signed-off-by: sunby <bingyi.sun@zilliz.com>
This commit is contained in:
parent
2cfdf22897
commit
bfc9e47e2c
@ -573,7 +573,10 @@ func TestGetFlushedSegments(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestService_WatchServices(t *testing.T) {
|
||||
svr := newTestServer(t, nil)
|
||||
factory := msgstream.NewPmsFactory()
|
||||
svr, err := CreateServer(context.TODO(), factory)
|
||||
assert.Nil(t, err)
|
||||
svr.serverLoopWg.Add(1)
|
||||
|
||||
ech := make(chan *sessionutil.SessionEvent)
|
||||
svr.eventCh = ech
|
||||
@ -596,6 +599,8 @@ func TestService_WatchServices(t *testing.T) {
|
||||
flag = false
|
||||
svr.eventCh = ech
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
svr.serverLoopWg.Add(1)
|
||||
|
||||
go func() {
|
||||
svr.startWatchService(ctx)
|
||||
flag = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user