Skip to content

Commit d6b99ed

Browse files
fix failing 8.0 test
1 parent 19ebaf0 commit d6b99ed

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

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

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
ObjectId,
1919
promiseWithResolvers
2020
} from '../../mongodb';
21-
import { type FailPoint } from '../../tools/utils';
21+
import { type FailPoint, waitUntilPoolsFilled } from '../../tools/utils';
2222

2323
// TODO(NODE-5824): Implement CSOT prose tests
2424
describe('CSOT spec prose tests', function () {
@@ -1154,34 +1154,37 @@ describe('CSOT spec prose tests', function () {
11541154
*
11551155
* 7. Verify that two `bulkWrite` commands were executed as part of the `MongoClient.bulkWrite` call.
11561156
*/
1157-
const failpoint: FailPoint = {
1158-
configureFailPoint: 'failCommand',
1159-
mode: {
1160-
times: 2
1161-
},
1162-
data: {
1163-
failCommands: ['bulkWrite'],
1164-
blockConnection: true,
1165-
blockTimeMS: 1010
1166-
}
1167-
};
1168-
11691157
let maxBsonObjectSize: number;
11701158
let maxMessageSizeBytes: number;
11711159

11721160
beforeEach(async function () {
11731161
await internalClient
11741162
.db('db')
1175-
.collection('coll')
1163+
.collection('coll_bulk_write')
11761164
.drop()
11771165
.catch(() => null);
1178-
await internalClient.db('admin').command(failpoint);
1166+
await internalClient.db('admin').command(<FailPoint>{
1167+
configureFailPoint: 'failCommand',
1168+
mode: {
1169+
times: 2
1170+
},
1171+
data: {
1172+
failCommands: ['bulkWrite'],
1173+
blockConnection: true,
1174+
blockTimeMS: 1000
1175+
}
1176+
});
11791177

1180-
const hello = await internalClient.db('admin').command({ hello: 1 });
1178+
const hello = await this.configuration.hello();
11811179
maxBsonObjectSize = hello.maxBsonObjectSize;
11821180
maxMessageSizeBytes = hello.maxMessageSizeBytes;
11831181

1184-
client = this.configuration.newClient({ timeoutMS: 2000, monitorCommands: true });
1182+
client = this.configuration.newClient(
1183+
{ timeoutMS: 4000, monitorCommands: true },
1184+
{ minPoolSize: 5 }
1185+
);
1186+
1187+
await waitUntilPoolsFilled(client, AbortSignal.timeout(30_000), 5);
11851188
});
11861189

11871190
it('performs two bulkWrites which fail to complete before 2000 ms', async function () {
@@ -1190,7 +1193,7 @@ describe('CSOT spec prose tests', function () {
11901193

11911194
const length = maxMessageSizeBytes / maxBsonObjectSize + 1;
11921195
const models = Array.from({ length }, () => ({
1193-
namespace: 'db.coll',
1196+
namespace: 'db.coll_bulk_write',
11941197
name: 'insertOne' as const,
11951198
document: { a: 'b'.repeat(maxBsonObjectSize - 500) }
11961199
}));

0 commit comments

Comments
 (0)