-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test(NODE-6626): implement integration tests for improved client.close() - server-side #4367
base: NODE-6620/sockets
Are you sure you want to change the base?
Conversation
ab9c495
to
34ccf67
Compare
34ccf67
to
804c464
Compare
await client.close(); | ||
await client.connect(); | ||
|
||
// assert clean-up |
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.
Note: We pass all cases already except cursors already.
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.
Should the other test cases be unskipped then?
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.
One comment about unskipping tests that pass, and some optional comments. Otherwise LGTM
|
||
it('all active server-side cursors are closed by client.close()', async function () { | ||
const getCursors = async () => { | ||
const res = await client |
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.
optional: this is the sort of thing for which we'd usually use a utilClient. If we use a separate client, we keep the client used for testing separate from the client we use to collect cluster data. It also avoids reopening the client after closing it in the test (line 729).
await client.close(); | ||
await client.connect(); | ||
|
||
// assert clean-up |
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.
Should the other test cases be unskipped then?
const res = await client | ||
.db() | ||
.admin() | ||
.command({ |
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.
(optional): Neal added runCursorCommand
last year to simplify running cursor commands manually:
const result = await client.db('admin').runCursorCommand({ aggregate: .... }).toArray();
return result.filter(
r => r.type === 'idleCursor' || (r.type === 'op' && r.desc === 'getMore')
);
Description
Add server-side resource integration tests for client.close(). These tests will remain skipped until improved client.close() is implemented.
What is changing?
Is there new documentation needed for these changes?
No
What is the motivation for this change?
Improved client.close()
Release Highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript