Skip to content

Commit e292a79

Browse files
authored
test(NODE-5855): unskip transaction tests (#4044)
1 parent 0ebc1ac commit e292a79

File tree

5 files changed

+55
-52
lines changed

5 files changed

+55
-52
lines changed

.evergreen/ci_matrix_constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const LATEST_LTS = NODE_VERSIONS[NODE_VERSIONS.length - 1];
1111
const TOPOLOGIES = ['server', 'replica_set', 'sharded_cluster'];
1212
const AWS_AUTH_VERSIONS = ['latest', '6.0', '5.0', '4.4'];
1313
const TLS_VERSIONS = ['latest', '6.0', '5.0', '4.4', '4.2'];
14+
const LB_VERSIONS = MONGODB_VERSIONS.slice(0, MONGODB_VERSIONS.indexOf('5.0') + 1);
15+
LB_VERSIONS.reverse();
1416

1517
const DEFAULT_OS = 'rhel80-large';
1618
const WINDOWS_OS = 'windows-vsCurrent-large';
@@ -24,6 +26,7 @@ module.exports = {
2426
MONGODB_VERSIONS,
2527
versions,
2628
NODE_VERSIONS,
29+
LB_VERSIONS,
2730
LOWEST_LTS,
2831
LATEST_LTS,
2932
TOPOLOGIES,

.evergreen/config.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,44 @@ tasks:
17851785
- func: start-load-balancer
17861786
- func: run-lb-tests
17871787
- func: stop-load-balancer
1788+
- name: test-7.0-load-balanced
1789+
tags:
1790+
- latest
1791+
- sharded_cluster
1792+
- load_balancer
1793+
commands:
1794+
- command: expansions.update
1795+
type: setup
1796+
params:
1797+
updates:
1798+
- {key: VERSION, value: '7.0'}
1799+
- {key: TOPOLOGY, value: sharded_cluster}
1800+
- {key: AUTH, value: auth}
1801+
- {key: LOAD_BALANCER, value: 'true'}
1802+
- func: install dependencies
1803+
- func: bootstrap mongo-orchestration
1804+
- func: start-load-balancer
1805+
- func: run-lb-tests
1806+
- func: stop-load-balancer
1807+
- name: test-rapid-load-balanced
1808+
tags:
1809+
- latest
1810+
- sharded_cluster
1811+
- load_balancer
1812+
commands:
1813+
- command: expansions.update
1814+
type: setup
1815+
params:
1816+
updates:
1817+
- {key: VERSION, value: rapid}
1818+
- {key: TOPOLOGY, value: sharded_cluster}
1819+
- {key: AUTH, value: auth}
1820+
- {key: LOAD_BALANCER, value: 'true'}
1821+
- func: install dependencies
1822+
- func: bootstrap mongo-orchestration
1823+
- func: start-load-balancer
1824+
- func: run-lb-tests
1825+
- func: stop-load-balancer
17881826
- name: test-latest-load-balanced
17891827
tags:
17901828
- latest
@@ -3955,6 +3993,8 @@ buildvariants:
39553993
- test-atlas-connectivity
39563994
- test-5.0-load-balanced
39573995
- test-6.0-load-balanced
3996+
- test-7.0-load-balanced
3997+
- test-rapid-load-balanced
39583998
- test-latest-load-balanced
39593999
- test-auth-kerberos
39604000
- test-auth-ldap
@@ -4006,6 +4046,8 @@ buildvariants:
40064046
- test-atlas-connectivity
40074047
- test-5.0-load-balanced
40084048
- test-6.0-load-balanced
4049+
- test-7.0-load-balanced
4050+
- test-rapid-load-balanced
40094051
- test-latest-load-balanced
40104052
- test-auth-kerberos
40114053
- test-auth-ldap
@@ -4057,6 +4099,8 @@ buildvariants:
40574099
- test-atlas-connectivity
40584100
- test-5.0-load-balanced
40594101
- test-6.0-load-balanced
4102+
- test-7.0-load-balanced
4103+
- test-rapid-load-balanced
40604104
- test-latest-load-balanced
40614105
- test-auth-kerberos
40624106
- test-auth-ldap
@@ -4107,6 +4151,8 @@ buildvariants:
41074151
- test-atlas-connectivity
41084152
- test-5.0-load-balanced
41094153
- test-6.0-load-balanced
4154+
- test-7.0-load-balanced
4155+
- test-rapid-load-balanced
41104156
- test-latest-load-balanced
41114157
- test-auth-kerberos
41124158
- test-auth-ldap

.evergreen/generate_evergreen_tasks.js

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const {
66
MONGODB_VERSIONS,
77
versions,
88
NODE_VERSIONS,
9+
LB_VERSIONS,
910
LOWEST_LTS,
1011
LATEST_LTS,
1112
TOPOLOGIES,
@@ -121,46 +122,12 @@ TASKS.push(
121122
tags: ['atlas-connect'],
122123
commands: [{ func: 'install dependencies' }, { func: 'run atlas tests' }]
123124
},
124-
{
125-
name: 'test-5.0-load-balanced',
126-
tags: ['latest', 'sharded_cluster', 'load_balancer'],
127-
commands: [
128-
updateExpansions({
129-
VERSION: '5.0',
130-
TOPOLOGY: 'sharded_cluster',
131-
AUTH: 'auth',
132-
LOAD_BALANCER: 'true'
133-
}),
134-
{ func: 'install dependencies' },
135-
{ func: 'bootstrap mongo-orchestration' },
136-
{ func: 'start-load-balancer' },
137-
{ func: 'run-lb-tests' },
138-
{ func: 'stop-load-balancer' }
139-
]
140-
},
141-
{
142-
name: 'test-6.0-load-balanced',
143-
tags: ['latest', 'sharded_cluster', 'load_balancer'],
144-
commands: [
145-
updateExpansions({
146-
VERSION: '6.0',
147-
TOPOLOGY: 'sharded_cluster',
148-
AUTH: 'auth',
149-
LOAD_BALANCER: 'true'
150-
}),
151-
{ func: 'install dependencies' },
152-
{ func: 'bootstrap mongo-orchestration' },
153-
{ func: 'start-load-balancer' },
154-
{ func: 'run-lb-tests' },
155-
{ func: 'stop-load-balancer' }
156-
]
157-
},
158-
{
159-
name: 'test-latest-load-balanced',
125+
...LB_VERSIONS.map(ver => ({
126+
name: `test-${ver}-load-balanced`,
160127
tags: ['latest', 'sharded_cluster', 'load_balancer'],
161128
commands: [
162129
updateExpansions({
163-
VERSION: 'latest',
130+
VERSION: ver,
164131
TOPOLOGY: 'sharded_cluster',
165132
AUTH: 'auth',
166133
LOAD_BALANCER: 'true'
@@ -171,7 +138,7 @@ TASKS.push(
171138
{ func: 'run-lb-tests' },
172139
{ func: 'stop-load-balancer' }
173140
]
174-
},
141+
})),
175142
{
176143
name: 'test-auth-kerberos',
177144
tags: ['auth', 'kerberos'],
@@ -750,7 +717,6 @@ BUILD_VARIANTS.push({
750717
tasks: AUTH_DISABLED_TASKS.map(({ name }) => name)
751718
});
752719

753-
754720
BUILD_VARIANTS.push({
755721
name: 'rhel8-test-lambda',
756722
display_name: 'AWS Lambda handler tests',

src/sessions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ export function maybeClearPinnedConnection(
519519

520520
if (options?.error == null || options?.force) {
521521
loadBalancer.pool.checkIn(conn);
522+
session[kPinnedConnection] = undefined;
522523
conn.emit(
523524
UNPINNED,
524525
session.transaction.state !== TxnState.NO_TRANSACTION
@@ -530,8 +531,6 @@ export function maybeClearPinnedConnection(
530531
loadBalancer.pool.clear({ serviceId: conn.serviceId });
531532
}
532533
}
533-
534-
session[kPinnedConnection] = undefined;
535534
}
536535
}
537536

test/integration/transactions/transactions.spec.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,9 @@ const SKIPPED_TESTS = [
1212
'transaction options inherited from defaultTransactionOptions',
1313
'transaction options inherited from client',
1414
'causal consistency disabled'
15-
// TODO(NODE-5855) - Gone away after NODE-5929
1615
];
1716

1817
describe('Transactions Spec Unified Tests', function () {
19-
this.beforeEach(function () {
20-
if (this.configuration.topologyType === 'LoadBalanced') {
21-
if (this.currentTest) {
22-
this.currentTest.skipReason =
23-
'TODO(NODE-5931) - Fix socket leaks in load balancer transaction tests.';
24-
}
25-
}
26-
this.skip();
27-
});
28-
2918
runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')), test => {
3019
return SKIPPED_TESTS.includes(test.description)
3120
? 'TODO(NODE-5924/NODE-5925): Skipping failing transaction tests'

0 commit comments

Comments
 (0)