Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Upgrade puppeteer #489

Merged
merged 2 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions dashboards-reports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"jquery": "^3.5.0",
"jsdom": "13.1.0",
"json-2-csv": "^3.7.6",
"puppeteer-core": "^1.19.0",
"puppeteer-core": "^13.7.0",
"react-addons-test-utils": "^15.6.2",
"react-id-generator": "^3.0.1",
"react-markdown": "^4.3.1",
Expand All @@ -44,7 +44,7 @@
"@types/dompurify": "^2.3.3",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/jsdom": "^16.2.3",
"@types/puppeteer-core": "^2.0.0",
"@types/puppeteer-core": "^5.4.0",
"@types/react": "^16.14.23",
"@types/react-addons-test-utils": "^0.14.25",
"@types/react-dom": "^16.9.8",
Expand Down
2 changes: 1 addition & 1 deletion dashboards-reports/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class ReportsDashboardsPlugin
this.initializerContext = context;
const timeoutError = new Error('Server busy');
timeoutError.statusCode = 503;
this.semaphore = withTimeout(new Semaphore(1), 180000, timeoutError);
this.semaphore = withTimeout(new Semaphore(1), 300000, timeoutError);
}

public async setup(core: CoreSetup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const createVisualReport = async (
'--disable-setuid-sandbox',
'--disable-gpu',
'--no-zygote',
'--single-process',
'--font-render-hinting=none',
'--js-flags="--jitless --no-opt"',
'--disable-features=V8OptimizeJavascript',
Expand All @@ -86,6 +85,7 @@ export const createVisualReport = async (
env: {
TZ: timezone || 'UTC',
},
pipe: true,
});
const page = await browser.newPage();

Expand Down Expand Up @@ -115,7 +115,7 @@ export const createVisualReport = async (
});

page.setDefaultNavigationTimeout(0);
page.setDefaultTimeout(100000); // use 100s timeout instead of default 30s
page.setDefaultTimeout(300000); // use 300s timeout instead of default 30s
// Set extra headers that are needed
if (!_.isEmpty(extraHeaders)) {
await page.setExtraHTTPHeaders(extraHeaders);
Expand Down Expand Up @@ -177,7 +177,7 @@ export const createVisualReport = async (
);

// force wait for any resize to load after the above DOM modification
await page.waitFor(1000);
await new Promise(resolve => setTimeout(resolve, 1000));
// crop content
switch (reportSource) {
case REPORT_TYPE.dashboard:
Expand Down Expand Up @@ -327,6 +327,6 @@ const waitForDynamicContent = async (
}

previousLength = currentLength;
await page.waitFor(interval);
await new Promise(resolve => setTimeout(resolve, interval));
}
};
Loading