mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
f051737ee4
This tests child process fork component in detached mode by spawning a parent process that creates a child process. We kill the parent process and check if the child is still running. Fixes: https://github.com/nodejs/node/issues/17592 PR-URL: https://github.com/nodejs/node/pull/24524 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
13 lines
235 B
JavaScript
13 lines
235 B
JavaScript
const fork = require('child_process').fork;
|
|
const path = require('path');
|
|
|
|
const child = fork(
|
|
path.join(__dirname, 'child-process-persistent.js'),
|
|
[],
|
|
{ detached: true, stdio: 'ignore' }
|
|
);
|
|
|
|
console.log(child.pid);
|
|
|
|
child.unref();
|