Fix bug for IndexCoord ut (#18148)

Signed-off-by: Cai.Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2022-07-07 18:52:21 +08:00 committed by GitHub
parent 44e59d6318
commit 0c883b215b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()