| 60 | } |
| 61 | |
| 62 | function testUnref(queueSize) { |
| 63 | return new Promise((resolve, reject) => { |
| 64 | let output = ''; |
| 65 | const child = fork(__filename, ['child', queueSize], { |
| 66 | stdio: [process.stdin, 'pipe', process.stderr, 'ipc'], |
| 67 | }); |
| 68 | child.on('close', (code) => { |
| 69 | if (code === 0) { |
| 70 | resolve(output.match(/\S+/g)); |
| 71 | } else { |
| 72 | reject(new Error('Child process died with code ' + code)); |
| 73 | } |
| 74 | }); |
| 75 | child.stdout.on('data', (data) => (output += data.toString())); |
| 76 | }) |
| 77 | .then((result) => assert.strictEqual(result.indexOf(0), -1)); |
| 78 | } |
| 79 | |
| 80 | new Promise(function testWithoutJSMarshaller(resolve) { |
| 81 | let callCount = 0; |