Skip to content

Commit 0711fe4

Browse files
committed
test: make sure the getMore is started
1 parent 4add48c commit 0711fe4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/integration/crud/misc_cursors.test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ describe('Cursor', function () {
18481848
}
18491849
});
18501850

1851-
it('closes cursors when client is closed even if it has not been exhausted', async function () {
1851+
it.only('closes cursors when client is closed even if it has not been exhausted', async function () {
18521852
await client
18531853
.db()
18541854
.dropCollection('test_cleanup_tailable')
@@ -1868,15 +1868,17 @@ describe('Cursor', function () {
18681868
// will block for maxAwaitTimeMS (except we are closing the client)
18691869
const rejectedEarlyBecauseClientClosed = cursor.next().catch(error => error);
18701870

1871+
for (
1872+
let [{ commandName }] = await once(client, 'commandStarted');
1873+
commandName !== 'getMore';
1874+
[{ commandName }] = await once(client, 'commandStarted')
1875+
);
1876+
18711877
await client.close();
18721878
expect(cursor).to.have.property('closed', true);
18731879

18741880
const error = await rejectedEarlyBecauseClientClosed;
1875-
if (this.configuration.topologyType === 'LoadBalanced') {
1876-
expect(error).to.be.instanceOf(MongoClientClosedError);
1877-
} else {
1878-
expect(error).to.be.null;
1879-
}
1881+
expect(error).to.be.instanceOf(MongoClientClosedError);
18801882
});
18811883

18821884
it('shouldAwaitData', {

0 commit comments

Comments
 (0)