Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[fix] Correctly kill test processes
  • Loading branch information
mmalecki committed Oct 29, 2012
1 parent 886a395 commit b8c27ed
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/core/run-single
Expand Up @@ -40,7 +40,6 @@ var path = require('path'),
common = require('./common');

var test = process.argv[2],
done = false,
testProcess;

if (!test) {
Expand All @@ -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.