Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix the hub down server down test

  • Loading branch information...
commit 16ee7b0deaad67e9a24923fa04781b27ef25365f 1 parent db04e6b
@substack authored
Showing with 5 additions and 3 deletions.
  1. +2 −2 index.js
  2. +3 −1 test/hub_down_server_down.js
View
4 index.js
@@ -44,7 +44,7 @@ Airport.prototype.connect = function (opts, fn) {
ports.get(role, onget);
function onget (ps) {
- ports.removeListener('down', ondown);
+ //ports.removeListener('down', ondown);
var s = pick(ps);
if (res) res.destroy();
@@ -60,7 +60,7 @@ Airport.prototype.connect = function (opts, fn) {
queue.forEach(function (cb) { res(cb) });
queue = [];
}
- //if (this._ondown) ports.removeListener('down', this._ondown);
+ if (this._ondown) ports.removeListener('down', this._ondown);
ports.on('down', ondown);
this._ondown = ondown;
View
4 test/hub_down_server_down.js
@@ -22,7 +22,9 @@ test('hub goes down, server goes down', function (t) {
var data = '';
ps.client.stdout.on('data', function (buf) { data += buf });
+ps.client.stderr.pipe(process.stderr, { end : false });
function checkOutput () {
+console.dir(data);
t.same(data.split(/\r?\n/).slice(-3)[0], 'down');
t.same(data.split(/\r?\n/).slice(-2)[0], 'up');
}
@@ -30,7 +32,7 @@ test('hub goes down, server goes down', function (t) {
setTimeout(function () {
ps.hub.kill();
ps.server.kill();
- }, 1000);
+ }, 1500);
setTimeout(function () {
ps.hub = sh('hub.js');
Please sign in to comment.
Something went wrong with that request. Please try again.