From 9a84f367827200536c77f9ad240ce0f6c9c29925 Mon Sep 17 00:00:00 2001 From: bailey Date: Mon, 25 Aug 2025 13:30:55 -0600 Subject: [PATCH 1/2] fix broken test --- .../node_csot.test.ts | 16 ++++++++++++---- test/tools/utils.ts | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/test/integration/client-side-operations-timeout/node_csot.test.ts b/test/integration/client-side-operations-timeout/node_csot.test.ts index 4656794b15c..a07b86b1500 100644 --- a/test/integration/client-side-operations-timeout/node_csot.test.ts +++ b/test/integration/client-side-operations-timeout/node_csot.test.ts @@ -1359,14 +1359,12 @@ describe('CSOT driver tests', metadata, () => { }); }); - // TODO(NODE-7118): Find a way to reimplement this test for latest server. - describe( + describe.only( '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 () { @@ -1375,6 +1373,11 @@ describe('CSOT driver tests', metadata, () => { beforeEach(async function () { client = this.configuration.newClient({ timeoutMS: 500 }); + await client.db('admin').command({ + configureFailPoint: 'maxTimeNeverTimeOut', + mode: 'alwaysOn' + }); + const failpoint: FailPoint = { configureFailPoint: 'failCommand', mode: { @@ -1391,6 +1394,11 @@ describe('CSOT driver tests', metadata, () => { }); afterEach(async function () { + await client.db('admin').command({ + configureFailPoint: 'maxTimeNeverTimeOut', + mode: 'off' + }); + await client.close(); }); diff --git a/test/tools/utils.ts b/test/tools/utils.ts index c4fa4ad6dae..537d5868338 100644 --- a/test/tools/utils.ts +++ b/test/tools/utils.ts @@ -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[]; From 99b919a391f96de8975cdd8851e0bcfdcfd6de8b Mon Sep 17 00:00:00 2001 From: bailey Date: Mon, 25 Aug 2025 13:32:19 -0600 Subject: [PATCH 2/2] remove .only() --- .../client-side-operations-timeout/node_csot.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/client-side-operations-timeout/node_csot.test.ts b/test/integration/client-side-operations-timeout/node_csot.test.ts index a07b86b1500..8adcce2ef69 100644 --- a/test/integration/client-side-operations-timeout/node_csot.test.ts +++ b/test/integration/client-side-operations-timeout/node_csot.test.ts @@ -1359,7 +1359,7 @@ describe('CSOT driver tests', metadata, () => { }); }); - describe.only( + describe( 'Connection after timeout', { requires: {