Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
setTimeout never works on travis
Browse files Browse the repository at this point in the history
Signed-off-by: Won Jun Jang <wjang@uber.com>
  • Loading branch information
black-adder committed Apr 10, 2018
1 parent b6196cd commit e48c4c7
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions test/throttler/remote_throttler.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ describe('RemoteThrottler should', () => {
throttler._credits[operation] = 0;
metrics.throttlerUpdateFailure.increment = function() {
assert.equal(logger._errorMsgs.length, 1, `errors=${logger._errorMsgs}`);
setTimeout(() => {
sinon.assert.notCalled(creditsUpdatedHook);
done();
}, 0);
done();
};
throttler._host = 'Llanfair­pwllgwyngyll­gogery­chwyrn­drobwll­llan­tysilio­gogo­goch';
throttler._refreshCredits();
Expand All @@ -144,10 +141,7 @@ describe('RemoteThrottler should', () => {
throttler._credits[operation] = 0;
metrics.throttlerUpdateFailure.increment = function() {
assert.equal(logger._errorMsgs.length, 1, `errors=${logger._errorMsgs}`);
setTimeout(() => {
sinon.assert.notCalled(creditsUpdatedHook);
done();
}, 0);
done();
};
server.addCredits(serviceName, 'not-json');
throttler._refreshCredits();
Expand All @@ -158,10 +152,7 @@ describe('RemoteThrottler should', () => {
throttler._credits[operation] = 0;
metrics.throttlerUpdateFailure.increment = function() {
assert.equal(logger._errorMsgs.length, 1, `errors=${logger._errorMsgs}`);
setTimeout(() => {
sinon.assert.notCalled(creditsUpdatedHook);
done();
}, 0);
done();
};
throttler._refreshCredits();
});
Expand Down

0 comments on commit e48c4c7

Please sign in to comment.