@@ -180,8 +180,6 @@ const runSuite = async (config: Config, spec: DeployedTestSuite, schemaValidator
180180 }
181181 logger . info ( "Test suite: '%s' - started using session: %s" , testSuiteId , startResult . sessionId )
182182
183- logger . info ( "Test suite: '%s' - session: %s, testSuite.timeoutSeconds: %s, config.testTimeoutMs: %s" , testSuiteId , startResult . sessionId , spec . testSuite . timeoutSeconds , config . testTimeoutMs )
184-
185183 const testTimeoutMs = spec . testSuite . timeoutSeconds * 1_000 || config . testTimeoutMs
186184 await waitUntilFinish ( api , testSuiteId , startResult . sessionId , config . testStatusPollFrequencyMs , testTimeoutMs , 1_000 )
187185
@@ -253,15 +251,11 @@ const waitUntilFinish = async (
253251 sessionId
254252 } )
255253 const statusUrl = `${ api . status . endpoint } ?${ queryParams } `
256- let response ;
257254 try {
258255 logger . info ( statusUrl )
259256 httpResponse = await fetch ( statusUrl , api . status . options )
260- response = await httpResponse . json ( )
261- logger . info ( "Test suite: '%s' - status endpoint %s for session: '%s' returned %s (%s)" , testSuiteId , statusUrl , sessionId , httpResponse . statusText , JSON . stringify ( response ) )
262257 } catch ( e ) {
263258 // allow x number of failed polls and then give up
264- logger . info ( "Test suite: '%s' - error polling status endpoint %s for session: '%s' " , testSuiteId , statusUrl , sessionId )
265259 if ( ++ failuresCount < MAX_TECH_FAILURES ) {
266260 const sleep = new Promise ( resolve => setTimeout ( resolve , retryTimeoutMs ) )
267261 await sleep
@@ -278,14 +272,16 @@ const waitUntilFinish = async (
278272 throw new Error ( `Unable to fetch status of previously started test: '${ testSuiteId } '. Error: '${ httpResponse . statusText } '` )
279273 }
280274
275+ const reponse = await httpResponse . json ( )
276+
281277 const { schemaValidator, schemaPath } = api . status . validator
282- const isResponseValid = schemaValidator . validate ( getSchemaRef ( schemaPath . Response ) , response )
278+ const isResponseValid = schemaValidator . validate ( getSchemaRef ( schemaPath . Response ) , reponse )
283279
284280 if ( ! isResponseValid ) {
285- throw new ApiSchemaValidationError ( schemaValidator . errorsText ( ) , statusUrl , JSON . stringify ( response ) )
281+ throw new ApiSchemaValidationError ( schemaValidator . errorsText ( ) , statusUrl , JSON . stringify ( reponse ) )
286282
287283 }
288- const statusQueryResult = webapi . StatusResponse . create ( response )
284+ const statusQueryResult = webapi . StatusResponse . create ( reponse )
289285 if ( statusQueryResult . status === webapi . TestStatus . COMPLETED ) break
290286
291287 if ( statusQueryResult . status === webapi . TestStatus . ERROR ) {
0 commit comments