Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[test fix] delay monitor events (fast linux VM)

  • Loading branch information...
commit 2b38aed818e503d1446ff2e5b5ee8d30840be1c3 1 parent 8ae2af1
@AndreasMadsen authored
Showing with 11 additions and 6 deletions.
  1. +5 −3 test/simple/monitor-abstract.js
  2. +6 −3 test/watchers/interface.js
View
8 test/simple/monitor-abstract.js
@@ -140,15 +140,17 @@ vows.describe('testing monitor abstact').addBatch({
'when shutting down the immortal group': {
topic: function () {
var self = this;
+ var processPid = monitor.pid.process;
+
monitor.shutdown(function () {
- self.callback(null, monitor);
+ self.callback(null, monitor, processPid);
});
},
'process event should emit': {
- topic: function (monitor) {
+ topic: function (monitor, processPid) {
var self = this;
- var processPid = monitor.pid.process;
+
monitor.once('process', function (state) {
self.callback(null, monitor, state, processPid);
});
View
9 test/watchers/interface.js
@@ -54,9 +54,12 @@
// monitor event emitted
emit: function (name, state, pid) {
- prope.pid[name] = pid;
- prope.emit(name, state);
- this.callback();
+ var self = this;
+ process.nextTick(function () {
+ prope.pid[name] = pid;
+ prope.emit(name, state);
+ self.callback();
+ });
}
});
listener.listen('TCP', common.temp('output'));

0 comments on commit 2b38aed

Please sign in to comment.
Something went wrong with that request. Please try again.