Skip to content

Commit d69ecc6

Browse files
committed
Revert "test: improve test-process-kill-null for Windows"
This reverts commit 44483b6. PR-URL: #14142 Fixes: #14141 Refs: #14099 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent d2aaf82 commit d69ecc6

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,29 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
const common = require('../common');
23+
require('../common');
2424
const assert = require('assert');
2525
const spawn = require('child_process').spawn;
2626

27-
const child = common.isWindows ? spawn('cmd.exe') : spawn('cat');
27+
const cat = spawn('cat');
28+
let called;
2829

29-
assert.ok(process.kill(child.pid, 0));
30+
assert.ok(process.kill(cat.pid, 0));
3031

31-
child.on('exit', common.mustCall(function() {
32+
cat.on('exit', function() {
3233
assert.throws(function() {
33-
process.kill(child.pid, 0);
34+
process.kill(cat.pid, 0);
3435
}, Error);
35-
}));
36+
});
3637

37-
child.stdout.on('data', common.mustCall(function() {
38-
process.kill(child.pid, 'SIGKILL');
39-
}));
38+
cat.stdout.on('data', function() {
39+
called = true;
40+
process.kill(cat.pid, 'SIGKILL');
41+
});
4042

4143
// EPIPE when null sig fails
42-
child.stdin.write('test');
44+
cat.stdin.write('test');
45+
46+
process.on('exit', function() {
47+
assert.ok(called);
48+
});

0 commit comments

Comments
 (0)