Permalink
Browse files

[fix] Correctly kill test processes

  • Loading branch information...
1 parent 886a395 commit b8c27ed565e416827b7c4bb123aa9ee119d008e6 @mmalecki mmalecki committed Oct 29, 2012
Showing with 5 additions and 8 deletions.
  1. +5 −8 test/core/run-single
View
@@ -40,7 +40,6 @@ var path = require('path'),
common = require('./common');
var test = process.argv[2],
- done = false,
testProcess;
if (!test) {
@@ -58,16 +57,14 @@ proxy.on('listening', function () {
testProcess.stdout.pipe(process.stdout);
testProcess.stderr.pipe(process.stderr);
- testProcess.on('exit', function () {
- done = true;
- process.exit();
+ testProcess.on('exit', function (code) {
+ process.exit(code);
});
});
-process.on('exit', function () {
- if (!done) {
- textProcess.kill();
- }
+process.on('SIGTERM', function () {
+ testProcess.kill();
+ process.exit(1);
});
// vim:filetype=javascript

0 comments on commit b8c27ed

Please sign in to comment.