Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/webdriver/src/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,17 @@ export default abstract class WebDriverRequest extends EventEmitter {
throw error
}

/**
* W3C `timeout` (e.g. page load timeout) means the driver already enforced the
* configured timeout. Retrying would spend more time than was configured, so terminate immediately.
*/
if (error.name === 'timeout') {
log.debug('Request timed out on the driver side - terminating request without retry')
this.emit('response', { error })
this.emit('performance', { request: fullRequestOptions, durationMillisecond, success: false, error, retryCount })
throw error
}

return retry(error, `Request failed with status ${response.statusCode} due to ${error.message}`)
}
}
Expand Down
Loading