Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Add ut for AsyncIndex #492

Merged
merged 1 commit into from
Oct 3, 2022
Merged

Conversation

smellthemoon
Copy link
Contributor

@smellthemoon smellthemoon commented Sep 30, 2022

Signed-off-by: lixinguo [email protected]
#486

@sre-ci-robot sre-ci-robot requested a review from foxspy September 30, 2022 07:21
@sre-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smellthemoon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify
Copy link

mergify bot commented Sep 30, 2022

@smellthemoon Please associate the related issue to the body of your Pull Request. (eg. “issue: #”)

}

protected:
int32_t query_sum = 10;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put it in an anonymous namespace outside this class and rephrase to constexpr int32_t kQuerySum = 10;

}
int32_t num_threads_after_query = knowhere::threadchecker::GetThreadNum(pid);
int32_t expected_num_threads =
knowhere::threadchecker::GetQueryOmpThread(conf_) * query_sum + num_threads_after_build;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build threads should be reused right?

int32_t num_threads_before_build = knowhere::threadchecker::GetThreadNum(pid);
index_->BuildAll(base_dataset, conf_);
int32_t num_threads_after_build = knowhere::threadchecker::GetThreadNum(pid);
EXPECT_GE(knowhere::threadchecker::GetBuildOmpThread(conf_),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why greater or equal instead of just equal?

int32_t num_threads_after_query = knowhere::threadchecker::GetThreadNum(pid);
int32_t expected_num_threads =
knowhere::threadchecker::GetQueryOmpThread(conf_) * query_sum + num_threads_after_build;
EXPECT_GE(expected_num_threads, num_threads_after_query);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question, why GE


protected:
knowhere::Config conf_;
knowhere::IndexType index_type_;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is not necessary

@mergify mergify bot added the ci-passed label Sep 30, 2022
Signed-off-by: lixinguo <[email protected]>
@liliu-z
Copy link
Member

liliu-z commented Sep 30, 2022

\lgtm

@mergify mergify bot added the ci-passed label Sep 30, 2022
@liliu-z
Copy link
Member

liliu-z commented Oct 3, 2022

/lgtm

@sre-ci-robot sre-ci-robot merged commit c683e8b into milvus-io:main Oct 3, 2022
hhy3 pushed a commit to hhy3/knowhere-archive that referenced this pull request Nov 8, 2022
Signed-off-by: lixinguo <[email protected]>

Signed-off-by: lixinguo <[email protected]>
Co-authored-by: lixinguo <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants