From 0c883b215b2e40794ba62fa656aec3dacc811dee Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Thu, 7 Jul 2022 18:52:21 +0800 Subject: [PATCH] Fix bug for IndexCoord ut (#18148) Signed-off-by: Cai.Zhang --- internal/indexcoord/index_builder_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/indexcoord/index_builder_test.go b/internal/indexcoord/index_builder_test.go index 52911b02fe..0c4b033902 100644 --- a/internal/indexcoord/index_builder_test.go +++ b/internal/indexcoord/index_builder_test.go @@ -250,17 +250,13 @@ func TestIndexBuilder(t *testing.T) { for { ib.taskMutex.Lock() - if len(ib.tasks) == 1 { + if len(ib.tasks) == 1 && indexTaskInProgress == ib.tasks[5] { ib.taskMutex.Unlock() break } ib.taskMutex.Unlock() time.Sleep(time.Second) } - - ib.taskMutex.RLock() - assert.Equal(t, indexTaskInProgress, ib.tasks[5]) - ib.taskMutex.RUnlock() }) ib.Stop()