Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

refactor: reduce netprovider unit test executing time #644

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Oct 20, 2020

As pegasus issue 567 shows, there are some unit tests are time-cosuming, tools_common.asio_network_provider_connection_threshold is one of them, it will cost 70017ms. This pull request is a refactor of this unit test to reduce its executing time, it will cost 2077ms to run this unit test.

@hycdong hycdong marked this pull request as ready for review October 20, 2020 03:31
Comment on lines +279 to +280
// not exceed threshold
for (int count = 0; count < CONN_THRESHOLD + 2; count++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why doesn't it exceed threshold when sessions count == CONN_THRESHOLD +2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Acutually, the count doesn't matter in not-exceed case, it will first create a client to create a new session, then close the session, so it will not exceed connection threshold, the count here only means the loop count.

@neverchanje neverchanje merged commit af60c5d into XiaoMi:master Oct 22, 2020
@hycdong hycdong deleted the update_asio_ut branch October 29, 2020 07:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants