Browse Source

Revert "test: improve test-process-kill-null for Windows"

This reverts commit 44483b6898.

PR-URL: https://github.com/nodejs/node/pull/14142
Fixes: https://github.com/nodejs/node/issues/14141
Refs: https://github.com/nodejs/node/pull/14099
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
Refael Ackermann 8 years ago
parent
commit
d69ecc6f51
No known key found for this signature in database GPG Key ID: CD704BD80FDDDB64
  1. 26
      test/parallel/test-process-kill-null.js

26
test/parallel/test-process-kill-null.js

@ -20,23 +20,29 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
const common = require('../common');
require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;
const child = common.isWindows ? spawn('cmd.exe') : spawn('cat');
const cat = spawn('cat');
let called;
assert.ok(process.kill(child.pid, 0));
assert.ok(process.kill(cat.pid, 0));
child.on('exit', common.mustCall(function() {
cat.on('exit', function() {
assert.throws(function() {
process.kill(child.pid, 0);
process.kill(cat.pid, 0);
}, Error);
}));
});
child.stdout.on('data', common.mustCall(function() {
process.kill(child.pid, 'SIGKILL');
}));
cat.stdout.on('data', function() {
called = true;
process.kill(cat.pid, 'SIGKILL');
});
// EPIPE when null sig fails
child.stdin.write('test');
cat.stdin.write('test');
process.on('exit', function() {
assert.ok(called);
});

Loading…
Cancel
Save