node/test/parallel/test-domain-dep0097.js
Caleb Everett 5ca2ab1ff5 test: fix address in use error
test-domain-dep0097.js was sporadically failing because it is a parallel
test and uses opens a default inspector port.

This commit changes to bind to a random free port

PR-URL: https://github.com/nodejs/node/pull/43199
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-06-13 17:30:13 -04:00

18 lines
428 B
JavaScript

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const assert = require('assert');
const domain = require('domain');
const inspector = require('inspector');
process.on('warning', common.mustCall((warning) => {
assert.strictEqual(warning.code, 'DEP0097');
assert.match(warning.message, /Triggered by calling emit on process/);
}));
domain.create().run(() => {
inspector.open(0);
});