Skip to content

Commit 43d5841

Browse files
committed
review feedback, re-enable leak checker in legacy spec runner
1 parent 4928ac5 commit 43d5841

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

test/functional/spec-runner/index.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,14 @@ function generateTopologyTests(testSuites, testContext, filter) {
129129
environmentRequirementList.forEach(requires => {
130130
const suiteName = `${testSuite.name} - ${requires.topology.join()}`;
131131
describe(suiteName, {
132-
// FIXME: calling this.skip() inside tests triggers the leak checker, disable until fixed
133-
metadata: { requires, sessions: { skipLeakTests: true } },
132+
metadata: { requires },
134133
test: function () {
135134
beforeEach(() => prepareDatabaseForSuite(testSuite, testContext));
136135
afterEach(() => testContext.cleanupAfterSuite());
137136
testSuite.tests.forEach(spec => {
138-
const maybeIt = shouldRunSpecTest.call(this, requires, spec, filter) ? it : it.skip;
137+
const maybeIt = shouldRunSpecTest(this.configuration, requires, spec, filter)
138+
? it
139+
: it.skip;
139140
maybeIt(spec.description, function () {
140141
let testPromise = Promise.resolve();
141142
if (spec.failPoint) {
@@ -159,9 +160,9 @@ function generateTopologyTests(testSuites, testContext, filter) {
159160
});
160161
}
161162

162-
function shouldRunSpecTest(requires, spec, filter) {
163+
function shouldRunSpecTest(configuration, requires, spec, filter) {
163164
if (requires.authEnabled && process.env.AUTH !== 'auth') {
164-
// TODO: We do not have a way to determine if auth is enabled in our mocha metadata
165+
// TODO(NODE-3488): We do not have a way to determine if auth is enabled in our mocha metadata
165166
// We need to do a admin.command({getCmdLineOpts: 1}) if it errors (code=13) auth is on
166167
return false;
167168
}
@@ -175,10 +176,7 @@ function shouldRunSpecTest(requires, spec, filter) {
175176
return false;
176177
}
177178

178-
if (
179-
spec.skipReason ||
180-
(filter && typeof filter === 'function' && !filter(spec, this.configuration))
181-
) {
179+
if (spec.skipReason || (filter && typeof filter === 'function' && !filter(spec, configuration))) {
182180
return false;
183181
}
184182
return true;

0 commit comments

Comments
 (0)