Skip to content

Commit

Permalink
test(NODE-5855): unskip transaction tests (#4044)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Mar 19, 2024
1 parent 0ebc1ac commit e292a79
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 52 deletions.
3 changes: 3 additions & 0 deletions .evergreen/ci_matrix_constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -24,6 +26,7 @@ module.exports = {
MONGODB_VERSIONS,
versions,
NODE_VERSIONS,
LB_VERSIONS,
LOWEST_LTS,
LATEST_LTS,
TOPOLOGIES,
Expand Down
46 changes: 46 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
44 changes: 5 additions & 39 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
MONGODB_VERSIONS,
versions,
NODE_VERSIONS,
LB_VERSIONS,
LOWEST_LTS,
LATEST_LTS,
TOPOLOGIES,
Expand Down Expand Up @@ -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'
Expand All @@ -171,7 +138,7 @@ TASKS.push(
{ func: 'run-lb-tests' },
{ func: 'stop-load-balancer' }
]
},
})),
{
name: 'test-auth-kerberos',
tags: ['auth', 'kerberos'],
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions src/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -530,8 +531,6 @@ export function maybeClearPinnedConnection(
loadBalancer.pool.clear({ serviceId: conn.serviceId });
}
}

session[kPinnedConnection] = undefined;
}
}

Expand Down
11 changes: 0 additions & 11 deletions test/integration/transactions/transactions.spec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit e292a79

Please sign in to comment.