File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,13 @@ function get(url) {
21
21
function getWithRetry ( url , retryCount , previousError ) {
22
22
retryCount = retryCount || 0 ;
23
23
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 ) ) ;
25
26
}
26
27
return get ( url )
27
28
. catch ( function ( error ) {
28
29
console . error ( 'error getting ' + url + ', retrying' ) ;
29
- return new Promise ( function ( resolve ) { setTimeout ( resolve , 1000 ) ; } )
30
+ return new Promise ( function ( resolve ) { setTimeout ( resolve , 10000 ) ; } )
30
31
. then ( function ( ) {
31
32
return getWithRetry ( url , retryCount + 1 , error ) ;
32
33
} ) ;
@@ -46,8 +47,11 @@ describe("Port function",function(){
46
47
} ) ;
47
48
48
49
it ( "Port value should be >= 0 and < 65536" , function ( ) {
49
- this . timeout ( 10000 ) ;
50
+ this . timeout ( 40000 ) ;
50
51
return service . startHandler ( )
52
+ . then ( function ( ) {
53
+ return new Promise ( function ( resolve ) { setTimeout ( resolve , 2000 ) ; } ) ;
54
+ } )
51
55
. then ( function ( ) {
52
56
console . log ( 'started handler' ) ;
53
57
return getWithRetry ( `http://localhost:${ service . port } /shell/` ) ;
You can’t perform that action at this time.
0 commit comments