diff options
author | timothy searcy <timmyzsearcy@gmail.com> | 2018-11-20 08:16:40 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-11-28 11:14:37 -0800 |
commit | f051737ee4ebb7dfa25abc91f7a4797bd8fe0cb6 (patch) | |
tree | 6e91e281a6ff8f4891a8ac07da41b9e4ce93bf9a /test/fixtures/parent-process-nonpersistent-fork.js | |
parent | 804138093abb2c63cfaba5ee058e18df19b38f3e (diff) | |
download | android-node-v8-f051737ee4ebb7dfa25abc91f7a4797bd8fe0cb6.tar.gz android-node-v8-f051737ee4ebb7dfa25abc91f7a4797bd8fe0cb6.tar.bz2 android-node-v8-f051737ee4ebb7dfa25abc91f7a4797bd8fe0cb6.zip |
test: test and docs for detached fork process
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>
Diffstat (limited to 'test/fixtures/parent-process-nonpersistent-fork.js')
-rw-r--r-- | test/fixtures/parent-process-nonpersistent-fork.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/fixtures/parent-process-nonpersistent-fork.js b/test/fixtures/parent-process-nonpersistent-fork.js new file mode 100644 index 0000000000..49c0a1d183 --- /dev/null +++ b/test/fixtures/parent-process-nonpersistent-fork.js @@ -0,0 +1,12 @@ +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(); |