Fix datanode unit test not stable (#21911) (#21915)

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/21931/head
yah01 2023-02-01 19:43:51 +08:00 committed by GitHub
parent 926c88ff18
commit 36b5012834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -911,11 +911,11 @@ func TestWatchChannel(t *testing.T) {
err = kv.RemoveWithPrefix(fmt.Sprintf("%s/%d", Params.DataNodeCfg.ChannelWatchSubPath, Params.DataNodeCfg.GetNodeID()))
assert.Nil(t, err)
//TODO there is not way to sync Release done, use sleep for now
time.Sleep(100 * time.Millisecond)
exist = node.flowgraphManager.exist(ch)
assert.False(t, exist)
assert.Eventually(t, func() bool {
exist = node.flowgraphManager.exist(ch)
return !exist
}, 3*time.Second, 100*time.Millisecond)
})
t.Run("Test release channel", func(t *testing.T) {