fixed and added a test for keepalive connection pool forced shutdown

This commit is contained in:
Spencer Alger
2014-02-06 22:30:29 -07:00
parent 7bb19ac357
commit 327f191056
6 changed files with 112 additions and 12 deletions

View File

@ -369,4 +369,26 @@ describe('Http Connector', function () {
});
});
describe('Connection cleanup', function () {
it('destroys any connections created', function (done) {
this.timeout(1000);
var cp = require('child_process');
var path = require('path');
var es = require('event-stream');
var proc = cp.fork(path.join(__dirname, '../../fixtures/keepalive.js'), {
silent: true
});
es.merge(
proc.stdout,
proc.stderr
).pipe(es.wait(function (err, output) {
expect(err).to.eql(null);
expect(output.trim()).to.eql('1');
done();
}));
});
});
});