Skip to content

Commit 46ea299

Browse files
test(NODE-7118): fix CSOT socket read failure test on latest servers (#4627)
1 parent 66706f8 commit 46ea299

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,14 +1359,12 @@ describe('CSOT driver tests', metadata, () => {
13591359
});
13601360
});
13611361

1362-
// TODO(NODE-7118): Find a way to reimplement this test for latest server.
13631362
describe(
13641363
'Connection after timeout',
13651364
{
13661365
requires: {
13671366
// 4.4 for use of failCommands
1368-
// < 8.3 because of https://jira.mongodb.org/browse/SERVER-101116
1369-
mongodb: '>=4.4 <=8.2'
1367+
mongodb: '>=4.4'
13701368
}
13711369
},
13721370
function () {
@@ -1375,6 +1373,11 @@ describe('CSOT driver tests', metadata, () => {
13751373
beforeEach(async function () {
13761374
client = this.configuration.newClient({ timeoutMS: 500 });
13771375

1376+
await client.db('admin').command(<FailPoint>{
1377+
configureFailPoint: 'maxTimeNeverTimeOut',
1378+
mode: 'alwaysOn'
1379+
});
1380+
13781381
const failpoint: FailPoint = {
13791382
configureFailPoint: 'failCommand',
13801383
mode: {
@@ -1391,6 +1394,11 @@ describe('CSOT driver tests', metadata, () => {
13911394
});
13921395

13931396
afterEach(async function () {
1397+
await client.db('admin').command(<FailPoint>{
1398+
configureFailPoint: 'maxTimeNeverTimeOut',
1399+
mode: 'off'
1400+
});
1401+
13941402
await client.close();
13951403
});
13961404

test/tools/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export function extractAuthFromConnectionString(connectionString: string | any[]
206206
}
207207

208208
export interface FailPoint {
209-
configureFailPoint: 'failCommand' | 'failGetMoreAfterCursorCheckout';
209+
configureFailPoint: 'failCommand' | 'failGetMoreAfterCursorCheckout' | 'maxTimeNeverTimeOut';
210210
mode: { activationProbability: number } | { times: number } | 'alwaysOn' | 'off';
211211
data: {
212212
failCommands: string[];

0 commit comments

Comments
 (0)