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

Navigation timeout when running benchmark-web-vitals on page with File block embedding PDF #70

Open
westonruter opened this issue Aug 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@westonruter
Copy link
Collaborator

I added a File block with a PDF being displayed inline:

image

When I attempt to test the performance of this page, I get timeout error:

$ npm run research -- benchmark-web-vitals -u https://wordpress.com/support/embed-a-pdf-file/ -n 1 -o csv

> research
> ./cli/run.mjs benchmark-web-vitals -u https://wordpress.com/support/embed-a-pdf-file/ -n 1 -o csv

TimeoutError: Navigation timeout of 30000 ms exceeded

Interestingly, if I change the value of waitUntil from networkidle0 to load:

diff --git a/cli/commands/benchmark-web-vitals.mjs b/cli/commands/benchmark-web-vitals.mjs
index 23ba228..59418be 100644
--- a/cli/commands/benchmark-web-vitals.mjs
+++ b/cli/commands/benchmark-web-vitals.mjs
@@ -252,7 +252,7 @@ async function benchmarkURL( browser, params ) {
 		// Load the page.
 		const response = await page.goto(
 			`${ params.url }?rnd=${ requestNum }`,
-			{ waitUntil: 'networkidle0' }
+			{ waitUntil: 'load' }
 		);
 		await page.addScriptTag( { content: scriptTag, type: 'module' } );

Then it works.

I don't have this issue for testing URLs that don't have embedded PDFs:

$ npm run research -- benchmark-web-vitals -u https://example.com/ -n 1 -o csv

> research
> ./cli/run.mjs benchmark-web-vitals -u https://example.com/ -n 1 -o csv

URL,https://example.com/
Success Rate,100%
FCP (median),148.6
LCP (median),148.6
TTFB (median),112.6
LCP-TTFB (median),36
@westonruter westonruter added the bug Something isn't working label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant