Skip to content

Commit e0ef193

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

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/integration/crud/misc_cursors.test.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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)