Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1359,14 +1359,12 @@ describe('CSOT driver tests', metadata, () => {
});
});

// TODO(NODE-7118): Find a way to reimplement this test for latest server.
describe(
'Connection after timeout',
{
requires: {
// 4.4 for use of failCommands
// < 8.3 because of https://jira.mongodb.org/browse/SERVER-101116
mongodb: '>=4.4 <=8.2'
mongodb: '>=4.4'
}
},
function () {
Expand All @@ -1375,6 +1373,11 @@ describe('CSOT driver tests', metadata, () => {
beforeEach(async function () {
client = this.configuration.newClient({ timeoutMS: 500 });

await client.db('admin').command(<FailPoint>{
configureFailPoint: 'maxTimeNeverTimeOut',
mode: 'alwaysOn'
});

const failpoint: FailPoint = {
configureFailPoint: 'failCommand',
mode: {
Expand All @@ -1391,6 +1394,11 @@ describe('CSOT driver tests', metadata, () => {
});

afterEach(async function () {
await client.db('admin').command(<FailPoint>{
configureFailPoint: 'maxTimeNeverTimeOut',
mode: 'off'
});

await client.close();
});

Expand Down
2 changes: 1 addition & 1 deletion test/tools/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function extractAuthFromConnectionString(connectionString: string | any[]
}

export interface FailPoint {
configureFailPoint: 'failCommand' | 'failGetMoreAfterCursorCheckout';
configureFailPoint: 'failCommand' | 'failGetMoreAfterCursorCheckout' | 'maxTimeNeverTimeOut';
mode: { activationProbability: number } | { times: number } | 'alwaysOn' | 'off';
data: {
failCommands: string[];
Expand Down