Skip to content

Commit 93746b7

Browse files
committed
fix tests
1 parent 77c4014 commit 93746b7

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ describe('CSOT spec prose tests', function () {
230230
data: {
231231
failCommands: ['getMore'],
232232
blockConnection: true,
233-
blockTimeMS: 20
233+
blockTimeMS: 90
234234
}
235235
};
236236
let internalClient: MongoClient;
@@ -248,7 +248,13 @@ describe('CSOT spec prose tests', function () {
248248
await coll.insertOne({ x: 1 });
249249
await internalClient.db().admin().command(failpoint);
250250

251-
client = this.configuration.newClient(undefined, { monitorCommands: true, timeoutMS: 20 });
251+
client = this.configuration.newClient(undefined, {
252+
monitorCommands: true,
253+
timeoutMS: 100,
254+
minPoolSize: 20
255+
});
256+
await client.connect();
257+
252258
commandStarted = [];
253259
commandSucceeded = [];
254260

test/integration/client-side-operations-timeout/node_csot.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* Anything javascript specific relating to timeouts */
2+
import { on } from 'node:events';
23
import { setTimeout } from 'node:timers/promises';
34

45
import { expect } from 'chai';
@@ -22,19 +23,11 @@ import {
2223
MongoServerError
2324
} from '../../mongodb';
2425
import { type FailPoint } from '../../tools/utils';
25-
import { on } from 'node:events';
2626

2727
const metadata = { requires: { mongodb: '>=4.4' } };
2828

29-
3029
describe('CSOT driver tests', metadata, () => {
3130
const minPoolSize = 20;
32-
async function ensurePoolIsFull(client: MongoClient) {
33-
let connectionCount = 0;
34-
for await (const _ of on(client, 'connectionCreated')) {
35-
if (connectionCount++ >= minPoolSize) break;
36-
}
37-
}
3831

3932
describe('timeoutMS inheritance', () => {
4033
let client: MongoClient;
@@ -586,7 +579,7 @@ describe('CSOT driver tests', metadata, () => {
586579
});
587580
});
588581

589-
describe.only('Tailable cursors', function () {
582+
describe('Tailable cursors', function () {
590583
let client: MongoClient;
591584
let internalClient: MongoClient;
592585
let commandStarted: CommandStartedEvent[];

0 commit comments

Comments
 (0)