Check indexnode mock error (#10204)

Signed-off-by: godchen <qingxiang.chen@zilliz.com>
pull/10891/head
godchen 2021-10-29 11:48:39 +08:00 committed by GitHub
parent c41bc0dede
commit bdbe9067f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -165,7 +165,9 @@ func (inm *Mock) Stop() error {
}
inm.cancel()
inm.wg.Wait()
inm.etcdKV.RemoveWithPrefix("session/" + typeutil.IndexNodeRole)
if err := inm.etcdKV.RemoveWithPrefix("session/" + typeutil.IndexNodeRole); err != nil {
return err
}
return nil
}
@ -176,7 +178,9 @@ func (inm *Mock) Register() error {
}
Params.Init()
inm.etcdKV, _ = etcdkv.NewEtcdKV(Params.EtcdEndpoints, Params.MetaRootPath)
inm.etcdKV.RemoveWithPrefix("session/" + typeutil.IndexNodeRole)
if err := inm.etcdKV.RemoveWithPrefix("session/" + typeutil.IndexNodeRole); err != nil {
return err
}
session := sessionutil.NewSession(context.Background(), Params.MetaRootPath, Params.EtcdEndpoints)
session.Init(typeutil.IndexNodeRole, "localhost:21121", false)
return nil