Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnfeldman committed Apr 13, 2016
1 parent ec19919 commit 8ed7d1f
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions tests-cluster/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var count = 0;
var server, token;
describe('test-cli', function () {
before(function (done) {
this.timeout(400000);
this.timeout(5000);
// initialize agent
tokenService.getToken({
org: org,
Expand All @@ -31,13 +31,12 @@ describe('test-cli', function () {
});

});
after(function (done) {
// close agent server before finishing
done();
});

it('load test-ish', function (done) {
this.timeout(100000)
this.timeout(400 * 1000)
count = 0;
var not200count = 0;
var now = Date.now();
async.times(1000, function (n, next) {
request({
method: 'GET',
Expand All @@ -46,14 +45,16 @@ describe('test-cli', function () {
"Authorization": "Bearer " + token.token
}
}, function (err, res, body) {
assert(res, err);
assert.equal(res.statusCode, 200, body);
count++;
next(err, res);
if(!err && res && res.statusCode == 200){
count++;
}else{
not200count++;
}
next();
});
}, function (err, responses) {
assert(!err, err);
console.log('finished with %s requests', count);
console.log('finished with %s good requests %s bad requests', count,not200count);
console.log('took %s',Date.now() - now)
done();
})

Expand Down

0 comments on commit 8ed7d1f

Please sign in to comment.