• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2require('../common');
3const assert = require('assert');
4const fork = require('child_process').fork;
5const fixtures = require('../common/fixtures');
6
7const nonPersistentNode = fork(
8  fixtures.path('parent-process-nonpersistent-fork.js'),
9  [],
10  { silent: true });
11
12let childId = -1;
13
14nonPersistentNode.stdout.on('data', (data) => {
15  childId = parseInt(data, 10);
16  nonPersistentNode.kill();
17});
18
19process.on('exit', () => {
20  assert.notStrictEqual(childId, -1);
21  // Killing the child process should not throw an error
22  process.kill(childId);
23});
24