Skip to content

Commit b8c27ed

Browse files
committed
[fix] Correctly kill test processes
1 parent 886a395 commit b8c27ed

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Diff for: test/core/run-single

+5-8
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var path = require('path'),
4040
common = require('./common');
4141

4242
var test = process.argv[2],
43-
done = false,
4443
testProcess;
4544

4645
if (!test) {
@@ -58,16 +57,14 @@ proxy.on('listening', function () {
5857
testProcess.stdout.pipe(process.stdout);
5958
testProcess.stderr.pipe(process.stderr);
6059

61-
testProcess.on('exit', function () {
62-
done = true;
63-
process.exit();
60+
testProcess.on('exit', function (code) {
61+
process.exit(code);
6462
});
6563
});
6664

67-
process.on('exit', function () {
68-
if (!done) {
69-
textProcess.kill();
70-
}
65+
process.on('SIGTERM', function () {
66+
testProcess.kill();
67+
process.exit(1);
7168
});
7269

7370
// vim:filetype=javascript

0 commit comments

Comments
 (0)