mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
52f8dcfccc
This commit updates the logic that checks for the end of the test run. Prior to this change, it was possible for root.run() to be called multiple times because of the way pending subtests were tracked. The extra calls to root.run() were harmless, but could trigger an EventEmitter leak warning due to 'abort' listeners being created. PR-URL: https://github.com/nodejs/node/pull/52326 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
12 lines
294 B
JavaScript
12 lines
294 B
JavaScript
// Flags: --test-only
|
|
'use strict';
|
|
const common = require('../common');
|
|
const { test } = require('node:test');
|
|
const { defaultMaxListeners } = require('node:events');
|
|
|
|
process.on('warning', common.mustNotCall());
|
|
|
|
for (let i = 0; i < defaultMaxListeners + 1; ++i) {
|
|
test(`test ${i + 1}`);
|
|
}
|