Skip to content

Commit

Permalink
Merge pull request #96 from semrush/browser-protocol-timeout
Browse files Browse the repository at this point in the history
Browser protocol timeout
  • Loading branch information
insidieux authored Sep 19, 2023
2 parents 3d2a45f + 2a0b8f9 commit 332c6e0
Show file tree
Hide file tree
Showing 9 changed files with 760 additions and 655 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 20.5
node-version: 20.6

- name: yarn
run: yarn --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
override APPLICATION_NAME=purr
override NODE_VERSION=20.5
override NODE_VERSION=20.6

DOCKER_IMAGE?=ghcr.io/semrush/purr
DOCKER_TAG?=latest
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=20.5
ARG NODE_VERSION=20.6

FROM node:${NODE_VERSION} as vendor

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@semrush/purr",
"version": "3.14.1",
"version": "3.15.2",
"description": "",
"main": "src/cli.cjs",
"scripts": {
Expand Down Expand Up @@ -57,7 +57,7 @@
"lodash.isempty": "^4.4.0",
"lodash.isundefined": "^3.0.1",
"morgan": "^1.10.0",
"nodemon": "^2.0.4",
"nodemon": "^3.0.1",
"nunjucks": "^3.2.4",
"prom-client": "^14.2.0",
"puppeteer": "^21.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/browser/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ exports.getBrowser = async (userAgent = config.userAgent, customArgs = []) => {

dumpio: config.browserDumpIO,
headless: config.browserHeadless ? 'new' : 'headful',
protocolTimeout: config.browserProtocolTimeout,
});
};

Expand Down
1 change: 1 addition & 0 deletions src/config/__tests__/configuration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('Test Configuration class', () => {
blockedResourceDomains: [],
browserDumpIO: false,
browserHeadless: true,
browserProtocolTimeout: 180000,
checksDir: '/rootDir/data/checks',
checksQueueName: 'checks-queue',
chromiumLaunchArgs: [],
Expand Down
5 changes: 5 additions & 0 deletions src/config/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ class Configuration {
false
);

this.browserProtocolTimeout = getDefault(
envParams.BROWSER_PROTOCOL_TIMEOUT,
180000
);

if (this.artifactsGroupByCheckName && isUndefined(this.artifactsDir)) {
throw new Error(
'Enabled group artifacts by check name and artifacts path not specified'
Expand Down
8 changes: 8 additions & 0 deletions src/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ const DEFAULT_ENV_PARAMS = {
* @default {true}
*/
BROWSER_DUMP_IO: false,

/**
* Browser protocol timeout
*
* @type {number}
* @default {180000}
*/
BROWSER_PROTOCOL_TIMEOUT: 180000,
};

class EnvParams {
Expand Down
1,390 changes: 740 additions & 650 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 332c6e0

Please sign in to comment.