Skip to content

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

Open
@westonruter

Description

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions