File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,21 @@ const debugVerbose = require('debug')('netlify-plugin-cypress:verbose')
99 */
1010const ping = ( url , timeout ) => {
1111 debug ( 'pinging "%s" for %d ms max' , url , timeout )
12+ const start = + new Date ( )
13+
1214 return got ( url , {
1315 retry : {
1416 limit : 30 ,
15- calculateDelay ( { attemptCount, retryOptions, error, computedValue} ) {
16- debugVerbose ( `attempt ${ attemptCount } ${ computedValue } ms ${ error . message } ` )
17+ calculateDelay ( { attemptCount, retryOptions, error} ) {
18+ const now = + new Date ( )
19+ const elapsed = now - start
20+ debugVerbose ( `attempt ${ attemptCount } ${ elapsed } ms ${ error . message } ` )
1721
18- if ( computedValue > timeout ) {
19- debug ( '%s timed out' , url )
20- console . error ( '%s timed out' , url )
22+ if ( elapsed > timeout ) {
23+ debug ( '%s timed out after %dms, timeout was %dms' ,
24+ url , elapsed , timeout )
25+ console . error ( '%s timed out after %dms, timeout was %dms' ,
26+ url , elapsed , timeout )
2127 return 0
2228 }
2329 return 1000
You can’t perform that action at this time.
0 commit comments