diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts index edbf8efaf5..ec2e32462a 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts @@ -8,7 +8,6 @@ import * as path from 'path'; // eslint-disable-next-line @typescript-eslint/no-restricted-imports import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption'; import { type MongoClient, WriteConcern } from '../../mongodb'; -import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration'; import { getEncryptExtraOptions } from '../../tools/utils'; describe('Client Side Encryption Prose Corpus Test', function () { @@ -146,8 +145,6 @@ describe('Client Side Encryption Prose Corpus Test', function () { } } - installNodeDNSWorkaroundHooks(); - let client: MongoClient; beforeEach(async function () { diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts index 15446ab7f0..d4fde19f68 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts @@ -6,7 +6,6 @@ import * as path from 'path'; // eslint-disable-next-line @typescript-eslint/no-restricted-imports import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption'; import { type CommandStartedEvent, MongoClient, type MongoClientOptions } from '../../mongodb'; -import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration'; import { getEncryptExtraOptions } from '../../tools/utils'; import { dropCollection } from '../shared'; @@ -104,8 +103,6 @@ const metadata = { } }; describe('Connection Pool Deadlock Prevention', function () { - installNodeDNSWorkaroundHooks(); - beforeEach(async function () { const url: string = this.configuration.url(); diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.14.decryption_events.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.14.decryption_events.test.ts index eb7270e552..c3658b0b9f 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.14.decryption_events.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.14.decryption_events.test.ts @@ -10,7 +10,6 @@ import { type MongoClient, MongoNetworkError } from '../../mongodb'; -import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration'; import { getEncryptExtraOptions } from '../../tools/utils'; const metadata: MongoDBMetadataUI = { @@ -27,8 +26,6 @@ const LOCAL_KEY = Buffer.from( ); describe('14. Decryption Events', metadata, function () { - installNodeDNSWorkaroundHooks(); - let setupClient: MongoClient; let clientEncryption; let keyId: Binary; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.21.automatic_data_encryption_keys.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.21.automatic_data_encryption_keys.test.ts index 9990d77376..5295535e52 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.21.automatic_data_encryption_keys.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.21.automatic_data_encryption_keys.test.ts @@ -5,7 +5,6 @@ import { ClientEncryption } from '../../../src/client-side-encryption/client_enc /* eslint-disable @typescript-eslint/no-restricted-imports */ import { MongoCryptCreateEncryptedCollectionError } from '../../../src/client-side-encryption/errors'; import { BSON, Collection, type Db, MongoServerError } from '../../mongodb'; -import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration'; const metadata: MongoDBMetadataUI = { requires: { @@ -19,8 +18,6 @@ const documentValidationFailureCode = 121; const typeMismatchCode = 14; describe('21. Automatic Data Encryption Keys', () => { - installNodeDNSWorkaroundHooks(); - let db: Db; let clientEncryption; let client; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts index 9aec9a2533..a650ff1930 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts @@ -8,7 +8,6 @@ import { Decimal128, type Document, Double, Long, type MongoClient } from '../.. import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption'; /* eslint-disable @typescript-eslint/no-restricted-imports */ import { MongoCryptError } from '../../../src/client-side-encryption/errors'; -import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration'; const getKmsProviders = () => { const result = EJSON.parse(process.env.CSFLE_KMS_PROVIDERS || '{}') as unknown as { @@ -135,8 +134,6 @@ const readEncryptedFieldsFile = (dataType: string): Promise => }); describe('Range Explicit Encryption', function () { - installNodeDNSWorkaroundHooks(); - let clientEncryption; let keyId; let keyVaultClient; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.test.js b/test/integration/client-side-encryption/client_side_encryption.prose.test.js index 6b0b7742ac..17aa23be69 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.test.js +++ b/test/integration/client-side-encryption/client_side_encryption.prose.test.js @@ -10,7 +10,6 @@ const { EJSON } = BSON; const { LEGACY_HELLO_COMMAND, MongoCryptError } = require('../../mongodb'); const { MongoServerError, MongoServerSelectionError, MongoClient } = require('../../mongodb'); const { getEncryptExtraOptions } = require('../../tools/utils'); -const { installNodeDNSWorkaroundHooks } = require('../../tools/runner/hooks/configuration'); const { coerce, gte } = require('semver'); const { @@ -79,8 +78,6 @@ describe('Client Side Encryption Prose Tests', metadata, function () { 'base64' ); - installNodeDNSWorkaroundHooks(); - describe('Data key and double encryption', function () { // Data key and double encryption // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/test/integration/client-side-encryption/client_side_encryption.spec.test.ts b/test/integration/client-side-encryption/client_side_encryption.spec.test.ts index e5c9ac93c9..36b20f4460 100644 --- a/test/integration/client-side-encryption/client_side_encryption.spec.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.spec.test.ts @@ -2,7 +2,6 @@ import * as path from 'path'; import { loadSpecTests } from '../../spec'; import { ClientSideEncryptionFilter } from '../../tools/runner/filters/client_encryption_filter'; -import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration'; import { gatherTestSuites, generateTopologyTests, @@ -70,8 +69,6 @@ describe('Client Side Encryption (Legacy)', function () { testContext ); - installNodeDNSWorkaroundHooks(); - after(() => testContext.teardown()); before(function () { @@ -124,8 +121,6 @@ describe('Client Side Encryption (Legacy)', function () { }); describe('Client Side Encryption (Unified)', function () { - installNodeDNSWorkaroundHooks(); - before(async function () { await filter.initializeFilter({} as any, {}); }); diff --git a/test/integration/client-side-encryption/driver.test.ts b/test/integration/client-side-encryption/driver.test.ts index 63e62c9fcc..c98071d57d 100644 --- a/test/integration/client-side-encryption/driver.test.ts +++ b/test/integration/client-side-encryption/driver.test.ts @@ -6,7 +6,6 @@ import * as crypto from 'crypto'; import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption'; import { type Collection, type CommandStartedEvent, type MongoClient } from '../../mongodb'; import * as BSON from '../../mongodb'; -import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration'; import { getEncryptExtraOptions } from '../../tools/utils'; const metadata = { @@ -23,8 +22,6 @@ describe('Client Side Encryption Functional', function () { const keyVaultCollName = 'datakeys'; const keyVaultNamespace = `${keyVaultDbName}.${keyVaultCollName}`; - installNodeDNSWorkaroundHooks(); - it('CSFLE_KMS_PROVIDERS should be valid EJSON', function () { const CSFLE_KMS_PROVIDERS = process.env.CSFLE_KMS_PROVIDERS; if (typeof CSFLE_KMS_PROVIDERS === 'string') { diff --git a/test/manual/socks5.test.ts b/test/manual/socks5.test.ts index a37907aff6..036f6babe7 100644 --- a/test/manual/socks5.test.ts +++ b/test/manual/socks5.test.ts @@ -2,7 +2,6 @@ import { expect } from 'chai'; import ConnectionString from 'mongodb-connection-string-url'; import { LEGACY_HELLO_COMMAND, MongoClient, MongoParseError } from '../mongodb'; -import { installNodeDNSWorkaroundHooks } from '../tools/runner/hooks/configuration'; /** * The SOCKS5_CONFIG environment variable is either a JSON 4-tuple @@ -34,8 +33,6 @@ describe('Socks5 Connectivity', function () { singleConnectionString.searchParams.set('serverSelectionTimeoutMS', '2000'); singleConnectionString.searchParams.set('readPreference', 'primaryPreferred'); - installNodeDNSWorkaroundHooks(); - context((proxyUsername ? 'with' : 'without') + ' Socks5 auth required', function () { context('with missing required Socks5 auth configuration', function () { if (!proxyUsername) { diff --git a/test/tools/runner/hooks/configuration.ts b/test/tools/runner/hooks/configuration.ts index 2e14960ca3..4214e448a2 100644 --- a/test/tools/runner/hooks/configuration.ts +++ b/test/tools/runner/hooks/configuration.ts @@ -11,8 +11,6 @@ import { AstrolabeTestConfiguration, TestConfiguration } from '../config'; import { getEnvironmentalOptions } from '../../utils'; import * as mock from '../../mongodb-mock/index'; import { inspect } from 'util'; -import { setDefaultResultOrder } from 'dns'; -import { coerce, gte } from 'semver'; import { ApiVersionFilter } from '../filters/api_version_filter'; import { AuthFilter } from '../filters/auth_filter'; @@ -207,28 +205,6 @@ const beforeAllPluginImports = () => { require('mocha-sinon'); }; -/** - * @remarks TODO(NODE-4884): once happy eyeballs support is added, we no longer need to set - * the default dns resolution order for CI - */ -export function installNodeDNSWorkaroundHooks() { - if (gte(coerce(process.version), coerce('18'))) { - // We set before hooks because some tests connect in before hooks - before(() => { - setDefaultResultOrder('ipv4first'); - }); - - // We set beforeEach hooks to make this resilient to test ordering and - // ensure each affected test has the correct ip address resolution setting - beforeEach(() => { - setDefaultResultOrder('ipv4first'); - }); - afterEach(() => { - setDefaultResultOrder('verbatim'); - }); - } -} - export const mochaHooks = { beforeAll: [beforeAllPluginImports, testConfigBeforeHook], beforeEach: [testSkipBeforeEachHook],