-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Description
Attach (recommended) or Link to PDF file
N/A
Web browser and its version
Firefox 137.0.1
Operating system and its version
Arch Linux
PDF.js version
5.1.91+
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
- Change https://github.com/mozilla/pdf.js/blob/master/test/integration/viewer_spec.mjs#L400 from
ittofit. - Run
npx gulp integrationtest --noFirefoxand notice the "must check that canvas perfectly fits the page whatever the zoom level is" test failing in Chrome (it works in Firefox; this can be verified withnpx gulp integrationtest --noChrome):
Failures:
1) PDF viewer Canvas fits the page must check that canvas perfectly fits the page whatever the zoom level is
Message:
ProtocolError: Runtime.callFunctionOn timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
Stack:
at <instance_members_initializer> (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:97:14)
at new Callback (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:101:16)
at CallbackRegistry.create (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:20:26)
at Connection._rawSend (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Connection.js:95:26)
at CdpCDPSession.send (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/CdpSession.js:70:33)
at #evaluate (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:360:50)
at ExecutionContext.evaluate (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:274:36)
at IsolatedWorld.evaluate (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/IsolatedWorld.js:97:30)
at CdpJSHandle.evaluate (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/node_modules/puppeteer-core/lib/esm/puppeteer/api/JSHandle.js:146:37)
at awaitPromise (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/test/integration/test_utils.mjs:133:18)
What is the expected behavior?
The test passes.
What went wrong?
The test fails.
Link to a viewer
No response
Additional context
This integration test started failing in #19807, but it was unfortunately missed due to the other intermittents masking it. It only breaks in Chrome (Firefox works fine), so it's most likely caused by the Puppeteer update from version 24.4.0 to version 24.6.1. I have bisected this by installing older Puppeteer versions and found that:
- version 24.4.0 works;
- version 24.5.0 works;
- version 24.6.0 fails;
- version 24.6.1 fails.
Therefore the regression range is between version 24.5.0 and 24.6.0. The list of commits is puppeteer/puppeteer@puppeteer-v24.5.0...puppeteer-v24.6.0. It might be caused by puppeteer/puppeteer@30b7ba8 as it introduced a new major version of Chrome.
I have debugged the test and found that it hangs on https://github.com/mozilla/pdf.js/blob/master/test/integration/viewer_spec.mjs#L426. Digging further shows that https://github.com/mozilla/pdf.js/blob/master/test/integration/test_utils.mjs#L595 doesn't resolve anymore, and we don't hit the if statement there so it must be https://github.com/mozilla/pdf.js/blob/master/test/integration/test_utils.mjs#L601 that no longer triggers resolve. This would mean that the scrollend doesn't trigger in Chrome anymore.