Skip to content

Commit

Permalink
fix test suit
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Dec 12, 2014
1 parent a4fd5cb commit decc23b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
6 changes: 1 addition & 5 deletions lib/God.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,20 @@ God.executeApp = function executeApp(env, cb) {
clu.removeAllListeners();
clu.process.removeAllListeners();
God.handleExit(clu, cst.ERROR_EXIT);
return false;
});

clu.once('exit', function cluExit(exited_clu, code) {
clu.removeAllListeners();
clu.process.removeAllListeners();
God.handleExit(clu, code);
return false;
});

clu.once('online', function cluOnline() {
console.log('App name:%s id:%s online', clu.pm2_env.name, clu.pm2_env.pm_id);
clu.pm2_env.status = cst.ONLINE_STATUS;
God.finalizeProcedure(clu);
if (cb) return cb(null, clu);
return false;
if (cb) cb(null, clu);
});

return false;
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = function ClusterMode(God) {
var self = this;

if (self.restarting === true) {
log('Already restarting skipping');
log('Already restarting, skipping');
return false;
}

Expand Down
6 changes: 5 additions & 1 deletion test/bash/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec "should pid file exists"

$pm2 stop all

sleep 0.5
sleep 1

ls echo-0.pid
ispec "should pid file be deleted once stopped"
Expand All @@ -79,11 +79,15 @@ $pm2 kill

$pm2 start echo.js -p echo.pid -i 1

sleep 1

ls echo-0.pid
spec "should pid file exists"

$pm2 stop all

sleep 1

ls echo-0.pid
ispec "should pid file be deleted once stopped"

Expand Down
4 changes: 4 additions & 0 deletions test/bash/json_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ $pm2 restart all.json
should 'should stop processes' 'online' 6
should 'should all script been restarted one time' 'restart_time: 1' 6

$pm2 kill

sleep 2

#
# CWD OPTION
#
Expand Down
4 changes: 2 additions & 2 deletions test/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ bash ./test/bash/log-timestamp.sh
spec "timetstamp prefix of pm2.log"
bash ./test/bash/cli.sh
spec "CLI basic test"
bash ./test/bash/watch.sh
spec "Watch feature"
bash ./test/bash/json_file.sh
spec "JSON file test"
bash ./test/bash/watch.sh
spec "Watch feature"
bash ./test/bash/harmony.sh
spec "Harmony test"
bash ./test/bash/log-custom.sh
Expand Down

0 comments on commit decc23b

Please sign in to comment.