@@ -7,8 +7,8 @@ const serverFlagPath = path.resolve(__dirname, 'serverStarted')
77const payload = {
88 "query" : "{ moduleConfigurations { module, config, controls { field, usage } } }"
99}
10- const timeout = 4 * 60 * 1000 // 4 minutes
11- const interval = 10000 // Check every 10 seconds
10+ const timeoutMinutes = 10
11+ const retryIntervalSeconds = 15
1212
1313function waitForServerToStart ( url ) {
1414 console . log ( 'Waiting for API server to start...' )
@@ -30,11 +30,13 @@ function waitForServerToStart(url) {
3030 }
3131 } )
3232 . catch ( error => {
33- if ( Date . now ( ) - startTime >= timeout ) {
34- return reject ( new Error ( 'Timed out waiting for the server to start' ) )
33+ if ( Date . now ( ) - startTime >= timeoutMinutes * 60 * 1000 ) {
34+ return reject (
35+ new Error ( `Timed out waiting for the server to start: ${ error . message } ` )
36+ )
3537 } else {
36- console . log ( `Retrying in ${ interval / 1000 } seconds...` )
37- return setTimeout ( checkServer , interval )
38+ console . log ( `Retrying in ${ retryIntervalSeconds } seconds...` )
39+ return setTimeout ( checkServer , retryIntervalSeconds * 1000 )
3840 }
3941 } )
4042 }
@@ -66,8 +68,9 @@ module.exports = defineConfig({
6668 return null
6769 } )
6870 . catch ( error => {
69- console . error ( 'Failed to start server:' , error )
70- return null
71+ console . error ( 'Failed to start server:' )
72+ console . error ( error . stack ) ;
73+ return reject ( error ) ;
7174 } )
7275 } ,
7376 removeSetupFile ( ) {
0 commit comments