-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor BaseConnectionPool empty method #585
base: main
Are you sure you want to change the base?
Refactor BaseConnectionPool empty method #585
Conversation
Looks good, needs a test please. |
d79eb8b
to
79efb7c
Compare
Signed-off-by: Bandini Bhopi <[email protected]>
79efb7c
to
3090248
Compare
Added UT with no connection. |
@@ -18,6 +18,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
- Bumps `eslint-config-prettier` from 8.8.0 to 9.0.0 | |||
### Changed | |||
- Make handling of long numerals an option that is disabled by default ([#557](https://github.com/opensearch-project/opensearch-js/pull/557)) | |||
- Refactor BaseConnectionPool empty method so that callback will always get called even when there is no connection ([#585](https://github.com/opensearch-project/opensearch-js/pull/585)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is really a bug fix, the callback should be called when there's no connections. So I would move this to fixes and say "Fix: ensure connection pool callback with no connections"
pool.empty(); | ||
t.equal(pool.size, 0); | ||
t.end(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test that ensures the callback is called, too?
Description
ConnectionPool.empty() never calls callback when there is no connection. Refactor empty method so that callback will get always called.
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
Check List
yarn run lint
doesn't show any errorsBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.