Skip to content

Commit 200c69e

Browse files
author
Chris Armstrong
committed
fix: timeout at startup
1 parent 7d6a153 commit 200c69e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/indexTest.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ function get(url) {
2121
function getWithRetry(url, retryCount, previousError) {
2222
retryCount = retryCount || 0;
2323
if (retryCount >= 3) {
24-
return Promise.reject('Exceeded retry count for get of ' + url, previousError);
24+
console.error('Exceeded retry count for get of ' + url, previousError);
25+
return Promise.reject(new Error('Exceeded retry count for get of ' + url));
2526
}
2627
return get(url)
2728
.catch(function(error) {
2829
console.error('error getting ' + url + ', retrying');
29-
return new Promise(function(resolve) { setTimeout(resolve, 1000); })
30+
return new Promise(function(resolve) { setTimeout(resolve, 10000); })
3031
.then(function() {
3132
return getWithRetry(url, retryCount + 1, error);
3233
});
@@ -46,8 +47,11 @@ describe("Port function",function(){
4647
});
4748

4849
it("Port value should be >= 0 and < 65536",function() {
49-
this.timeout(10000);
50+
this.timeout(40000);
5051
return service.startHandler()
52+
.then(function() {
53+
return new Promise(function(resolve) { setTimeout(resolve, 2000); });
54+
})
5155
.then(function() {
5256
console.log('started handler');
5357
return getWithRetry(`http://localhost:${service.port}/shell/`);

0 commit comments

Comments
 (0)