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) {
2121function 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/` ) ;
You can’t perform that action at this time.
0 commit comments