Fix indexnode ut bug (#19468)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/19479/head
cai.zhang 2022-09-27 14:56:52 +08:00 committed by GitHub
parent f6e7b92db6
commit 2442335aa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -217,7 +217,7 @@ func TestIndexNodeComplex(t *testing.T) {
var i int64
t.Logf("preparing mock data...")
wg := sync.WaitGroup{}
for i = 0; i < 256; i++ {
for i = 0; i < 10; i++ {
task := &testTask{
buildID: i + buildID0,
collID: i + collID0,
@ -289,6 +289,7 @@ Loop:
if jobNumRet.TotalJobNum == 0 {
break Loop
}
time.Sleep(time.Second)
}
}
buildIDs := make([]int64, 0, len(tasks))

View File

@ -212,6 +212,7 @@ func (sched *TaskScheduler) processTask(t task, q TaskQueue) {
}()
sched.IndexBuildQueue.AddActiveTask(t)
defer sched.IndexBuildQueue.PopActiveTask(t.Name())
log.Ctx(t.Ctx()).Debug("process task", zap.String("task", t.Name()))
pipelines := []func(context.Context) error{t.Prepare, t.LoadData, t.BuildIndex, t.SaveIndexFiles}
for _, fn := range pipelines {
if err := wrap(fn); err != nil {