Fix bug: data race caused by read and write Params.DataNodeCfg.NodeID (#16478)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
zhenshan.cao 2022-04-13 20:09:34 +08:00 committed by GitHub
parent a5ac637ba5
commit eae0747f14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,6 +80,7 @@ func TestDataNode(t *testing.T) {
assert.Nil(t, err)
err = node.Start()
assert.Nil(t, err)
defer node.Stop()
node.chunkManager = storage.NewLocalChunkManager(storage.RootPath("/tmp/lib/milvus"))
Params.DataNodeCfg.NodeID = 1
@ -399,6 +400,7 @@ func TestWatchChannel(t *testing.T) {
assert.Nil(t, err)
err = node.Start()
assert.Nil(t, err)
defer node.Stop()
err = node.Register()
assert.Nil(t, err)