diff --git a/.evergreen/ci_matrix_constants.js b/.evergreen/ci_matrix_constants.js index b0a4948775c..a0a514c22f2 100644 --- a/.evergreen/ci_matrix_constants.js +++ b/.evergreen/ci_matrix_constants.js @@ -11,6 +11,8 @@ const LATEST_LTS = NODE_VERSIONS[NODE_VERSIONS.length - 1]; const TOPOLOGIES = ['server', 'replica_set', 'sharded_cluster']; const AWS_AUTH_VERSIONS = ['latest', '6.0', '5.0', '4.4']; const TLS_VERSIONS = ['latest', '6.0', '5.0', '4.4', '4.2']; +const LB_VERSIONS = MONGODB_VERSIONS.slice(0, MONGODB_VERSIONS.indexOf('5.0') + 1); +LB_VERSIONS.reverse(); const DEFAULT_OS = 'rhel80-large'; const WINDOWS_OS = 'windows-vsCurrent-large'; @@ -24,6 +26,7 @@ module.exports = { MONGODB_VERSIONS, versions, NODE_VERSIONS, + LB_VERSIONS, LOWEST_LTS, LATEST_LTS, TOPOLOGIES, diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 8b7fe4eda2c..10a119af4b0 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1785,6 +1785,44 @@ tasks: - func: start-load-balancer - func: run-lb-tests - func: stop-load-balancer + - name: test-7.0-load-balanced + tags: + - latest + - sharded_cluster + - load_balancer + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '7.0'} + - {key: TOPOLOGY, value: sharded_cluster} + - {key: AUTH, value: auth} + - {key: LOAD_BALANCER, value: 'true'} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: start-load-balancer + - func: run-lb-tests + - func: stop-load-balancer + - name: test-rapid-load-balanced + tags: + - latest + - sharded_cluster + - load_balancer + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: rapid} + - {key: TOPOLOGY, value: sharded_cluster} + - {key: AUTH, value: auth} + - {key: LOAD_BALANCER, value: 'true'} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: start-load-balancer + - func: run-lb-tests + - func: stop-load-balancer - name: test-latest-load-balanced tags: - latest @@ -3955,6 +3993,8 @@ buildvariants: - test-atlas-connectivity - test-5.0-load-balanced - test-6.0-load-balanced + - test-7.0-load-balanced + - test-rapid-load-balanced - test-latest-load-balanced - test-auth-kerberos - test-auth-ldap @@ -4006,6 +4046,8 @@ buildvariants: - test-atlas-connectivity - test-5.0-load-balanced - test-6.0-load-balanced + - test-7.0-load-balanced + - test-rapid-load-balanced - test-latest-load-balanced - test-auth-kerberos - test-auth-ldap @@ -4057,6 +4099,8 @@ buildvariants: - test-atlas-connectivity - test-5.0-load-balanced - test-6.0-load-balanced + - test-7.0-load-balanced + - test-rapid-load-balanced - test-latest-load-balanced - test-auth-kerberos - test-auth-ldap @@ -4107,6 +4151,8 @@ buildvariants: - test-atlas-connectivity - test-5.0-load-balanced - test-6.0-load-balanced + - test-7.0-load-balanced + - test-rapid-load-balanced - test-latest-load-balanced - test-auth-kerberos - test-auth-ldap diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 84bb84e75b0..c45273234f3 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -6,6 +6,7 @@ const { MONGODB_VERSIONS, versions, NODE_VERSIONS, + LB_VERSIONS, LOWEST_LTS, LATEST_LTS, TOPOLOGIES, @@ -121,46 +122,12 @@ TASKS.push( tags: ['atlas-connect'], commands: [{ func: 'install dependencies' }, { func: 'run atlas tests' }] }, - { - name: 'test-5.0-load-balanced', - tags: ['latest', 'sharded_cluster', 'load_balancer'], - commands: [ - updateExpansions({ - VERSION: '5.0', - TOPOLOGY: 'sharded_cluster', - AUTH: 'auth', - LOAD_BALANCER: 'true' - }), - { func: 'install dependencies' }, - { func: 'bootstrap mongo-orchestration' }, - { func: 'start-load-balancer' }, - { func: 'run-lb-tests' }, - { func: 'stop-load-balancer' } - ] - }, - { - name: 'test-6.0-load-balanced', - tags: ['latest', 'sharded_cluster', 'load_balancer'], - commands: [ - updateExpansions({ - VERSION: '6.0', - TOPOLOGY: 'sharded_cluster', - AUTH: 'auth', - LOAD_BALANCER: 'true' - }), - { func: 'install dependencies' }, - { func: 'bootstrap mongo-orchestration' }, - { func: 'start-load-balancer' }, - { func: 'run-lb-tests' }, - { func: 'stop-load-balancer' } - ] - }, - { - name: 'test-latest-load-balanced', + ...LB_VERSIONS.map(ver => ({ + name: `test-${ver}-load-balanced`, tags: ['latest', 'sharded_cluster', 'load_balancer'], commands: [ updateExpansions({ - VERSION: 'latest', + VERSION: ver, TOPOLOGY: 'sharded_cluster', AUTH: 'auth', LOAD_BALANCER: 'true' @@ -171,7 +138,7 @@ TASKS.push( { func: 'run-lb-tests' }, { func: 'stop-load-balancer' } ] - }, + })), { name: 'test-auth-kerberos', tags: ['auth', 'kerberos'], @@ -750,7 +717,6 @@ BUILD_VARIANTS.push({ tasks: AUTH_DISABLED_TASKS.map(({ name }) => name) }); - BUILD_VARIANTS.push({ name: 'rhel8-test-lambda', display_name: 'AWS Lambda handler tests', diff --git a/src/sessions.ts b/src/sessions.ts index 4738c0f64e5..21b17df6082 100644 --- a/src/sessions.ts +++ b/src/sessions.ts @@ -519,6 +519,7 @@ export function maybeClearPinnedConnection( if (options?.error == null || options?.force) { loadBalancer.pool.checkIn(conn); + session[kPinnedConnection] = undefined; conn.emit( UNPINNED, session.transaction.state !== TxnState.NO_TRANSACTION @@ -530,8 +531,6 @@ export function maybeClearPinnedConnection( loadBalancer.pool.clear({ serviceId: conn.serviceId }); } } - - session[kPinnedConnection] = undefined; } } diff --git a/test/integration/transactions/transactions.spec.test.ts b/test/integration/transactions/transactions.spec.test.ts index b892e97dc8b..a6ed914349f 100644 --- a/test/integration/transactions/transactions.spec.test.ts +++ b/test/integration/transactions/transactions.spec.test.ts @@ -12,20 +12,9 @@ const SKIPPED_TESTS = [ 'transaction options inherited from defaultTransactionOptions', 'transaction options inherited from client', 'causal consistency disabled' - // TODO(NODE-5855) - Gone away after NODE-5929 ]; describe('Transactions Spec Unified Tests', function () { - this.beforeEach(function () { - if (this.configuration.topologyType === 'LoadBalanced') { - if (this.currentTest) { - this.currentTest.skipReason = - 'TODO(NODE-5931) - Fix socket leaks in load balancer transaction tests.'; - } - } - this.skip(); - }); - runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')), test => { return SKIPPED_TESTS.includes(test.description) ? 'TODO(NODE-5924/NODE-5925): Skipping failing transaction tests'