Fix proxy unittest (#10289)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/10355/head
zhenshan.cao 2021-10-21 15:30:36 +08:00 committed by GitHub
parent 0a1529cf7e
commit a287bcf49d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -304,7 +304,7 @@ func runIndexNode(ctx context.Context, localMsg bool, alias string) *grpcindexno
func TestProxy(t *testing.T) { func TestProxy(t *testing.T) {
var err error var err error
path := "/tmp/milvus/rocksmq" path := "/tmp/milvus/rocksmq" + funcutil.GenRandomStr()
err = os.Setenv("ROCKSMQ_PATH", path) err = os.Setenv("ROCKSMQ_PATH", path)
defer os.RemoveAll(path) defer os.RemoveAll(path)
assert.NoError(t, err) assert.NoError(t, err)
@ -1166,7 +1166,7 @@ func TestProxy(t *testing.T) {
// waiting for collection to be loaded // waiting for collection to be loaded
counter := 0 counter := 0
for !f() { for !f() {
if counter > 10 { if counter > 100 {
loaded = false loaded = false
break break
} }
@ -1175,9 +1175,7 @@ func TestProxy(t *testing.T) {
counter++ counter++
} }
}) })
if !loaded { assert.True(t, loaded)
log.Warn("load operation was not sure to be done")
}
wg.Add(1) wg.Add(1)
t.Run("show in-memory collections", func(t *testing.T) { t.Run("show in-memory collections", func(t *testing.T) {