diff --git a/internal/datanode/data_node_test.go b/internal/datanode/data_node_test.go index b633f2d99a..02a60cc9ee 100644 --- a/internal/datanode/data_node_test.go +++ b/internal/datanode/data_node_test.go @@ -293,11 +293,11 @@ func TestWatchChannel(t *testing.T) { err = kv.RemoveWithPrefix(fmt.Sprintf("%s/%d", Params.CommonCfg.DataCoordWatchSubPath.GetValue(), paramtable.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) {