diff --git a/client/index.go b/client/index.go index 6f725aae..6b717136 100644 --- a/client/index.go +++ b/client/index.go @@ -90,11 +90,6 @@ func (c *GrpcClient) CreateIndex(ctx context.Context, collName string, fieldName return err } - flushErr := c.Flush(ctx, collName, true) - if flushErr != nil { - return flushErr - } - idxDef := getIndexDef(opts...) req := &milvuspb.CreateIndexRequest{ diff --git a/client/index_test.go b/client/index_test.go index eea34bc8..f1ca827f 100644 --- a/client/index_test.go +++ b/client/index_test.go @@ -41,17 +41,6 @@ func TestGrpcClientCreateIndex(t *testing.T) { assert.Nil(t, c.CreateIndex(ctx, testCollectionName, fieldName, idx, true)) }) - t.Run("test flush err", func(t *testing.T) { - mockServer.SetInjection(MFlush, func(_ context.Context, raw proto.Message) (proto.Message, error) { - resp := &milvuspb.FlushResponse{} - s, err := BadRequestStatus() - resp.Status = s - return resp, err - }) - defer mockServer.DelInjection(MFlush) - assert.NotNil(t, c.CreateIndex(ctx, testCollectionName, fieldName, idx, false)) - }) - t.Run("test sync create index", func(t *testing.T) { buildTime := rand.Intn(900) + 100 start := time.Now()