mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 03:13:13 +00:00

The inspector tests should not be in the parallel directory as they likely all (or certainly almost all) use static ports, so port collisions will happen. This moves them all to sequential. We can move them back on a case-by-case basis. They were run sequentially when they were in the inspector directory which they were only moved from very recently. PR-URL: https://github.com/nodejs/node/pull/16281 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com>
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
const assert = require('assert');
|
|
const { NodeInstance } = require('../common/inspector-helper.js');
|
|
|
|
async function runTests() {
|
|
const child = new NodeInstance(['--inspect=0'],
|
|
`let c = 0;
|
|
const interval = setInterval(() => {
|
|
console.log(new Object());
|
|
if (c++ === 10)
|
|
clearInterval(interval);
|
|
}, 10);`);
|
|
const session = await child.connectInspectorSession();
|
|
|
|
session.send([
|
|
{ 'method': 'Profiler.setSamplingInterval', 'params': { 'interval': 100 } },
|
|
{ 'method': 'Profiler.enable' },
|
|
{ 'method': 'Runtime.runIfWaitingForDebugger' },
|
|
{ 'method': 'Profiler.start' }]);
|
|
while (await child.nextStderrString() !==
|
|
'Waiting for the debugger to disconnect...');
|
|
await session.send({ 'method': 'Profiler.stop' });
|
|
session.disconnect();
|
|
assert.strictEqual(0, (await child.expectShutdown()).exitCode);
|
|
}
|
|
|
|
common.crashOnUnhandledRejection();
|
|
runTests();
|