GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: wait for inspector restart before exit · nodejs/node@c01f8df

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-inspector-debug-end.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-inspector-debug-end.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-inspector-debug-end.js
+10-5Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,23 @@ async function testNoSessionNoCrash() {
2222
async function testSessionNoCrash() {
2323
console.log('Test there\'s no crash stopping server after connecting');
2424
const script = `process._debugEnd();
25-
process._debugProcess(process.pid);
26-
setTimeout(() => {
27-
console.log("Done");
28-
process.exit(42);
29-
});`;
25+
process.stdin.once('data', () => {
26+
console.log("Done");
27+
process.exit(42);
28+
});
29+
process._debugProcess(process.pid);`;
3030

3131
const instance = new NodeInstance('--inspect-brk=0', script);
3232
const session = await instance.connectInspectorSession();
3333
await session.send({ method: 'NodeRuntime.enable' });
3434
await session.waitForNotification('NodeRuntime.waitingForDebugger');
35+
instance.resetPort();
3536
await session.send({ 'method': 'Runtime.runIfWaitingForDebugger' });
3637
await session.waitForServerDisconnect();
38+
// _debugProcess() starts the inspector asynchronously. Wait for the new
39+
// server to listen before asking the child to exit.
40+
await instance.portPromise;
41+
instance.write('exit');
3742
assert.strictEqual((await instance.expectShutdown()).exitCode, 42);
3843
}
3944

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.