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

Fix integration test "Interaction in autoprint.pdf must check if printing is triggered when the document is open" #16965

Closed
timvandermeij opened this issue Sep 17, 2023 · 2 comments · Fixed by #17021, #17090 or #17122
Assignees

Comments

@timvandermeij
Copy link
Contributor

Introduction date: January 4, 2023
Introduction PR: dea2471 (/cc @calixteman)
Type: intermittent (sometimes it works, indicating a possible timing/waiting issue)
OS: Windows and Linux
Logs: http://54.241.84.105:8877/59bc2f26a8990da/output.txt
Traceback:

Failures:
1) Interaction in autoprint.pdf must check if printing is triggered when the document is open
  Message:
�[31m    Error: Timeout - Async function did not complete within 30000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)�[0m
  Stack:
        at <Jasmine>
        at listOnTimeout (node:internal/timers:569:17)
        at process.processTimers (node:internal/timers:512:7)

Suite error: Interaction in autoprint.pdf
  Message:
�[31m    TargetCloseError: Protocol error (Runtime.callFunctionOn): Target closed�[0m
  Stack:
    error properties: Object({ cause: ProtocolError })
        at CallbackRegistry.clear (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:142:36)
        at CDPSessionImpl._onClosed (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:493:25)
        at Connection.onMessage (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:251:25)
        at WebSocket.<anonymous> (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/NodeWebSocketTransport.js:46:32)
        at callListener (/home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/ws/lib/event-target.js:290:14)
        at WebSocket.onMessage (/home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/ws/lib/event-target.js:209:9)
        at WebSocket.emit (node:events:513:28)
        at Receiver.receiverOnMessage (/home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/ws/lib/websocket.js:1192:20)
        at Receiver.emit (node:events:513:28)
        at Receiver.dataMessage (/home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/ws/lib/receiver.js:558:14)
    Caused by: ProtocolError
        at <instance_members_initializer> (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:46:14)
        at new Callback (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:50:16)
        at CallbackRegistry.create (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:89:26)
        at Connection._rawSend (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:210:26)
        at CDPSessionImpl.send (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js:458:33)
        at #evaluate (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:231:50)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async ExecutionContext.evaluateHandle (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:198:16)
        at async IsolatedWorld.evaluateHandle (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/common/IsolatedWorld.js:119:16)
        at async CDPJSHandle.evaluateHandle (file:///home/ubuntu/pdfjs/botio-files-pdfjs/private/59bc2f26a8990da/node_modules/puppeteer-core/lib/esm/puppeteer/api/JSHandle.js:156:20)
@timvandermeij
Copy link
Contributor Author

timvandermeij commented Oct 7, 2023

Reopening because the PR was enough to solve the issue on Linux, but on Windows the issue remains sometimes, for example in http://54.193.163.58:8877/2f79653a96667de/output.txt and http://54.193.163.58:8877/ec07744f28d6bce/output.txt.

@timvandermeij
Copy link
Contributor Author

timvandermeij commented Oct 14, 2023

Reopening because this test still fails on Windows sometimes, albeit much less than before. One occurrence I found from last week is http://54.193.163.58:8877/4bb1d0f530d0f12/output.txt where scripting_spec.js:1796:31 points to pressing the Escape key. This is interesting because it showed that the previous fixes above all worked and because that action shouldn't even be necessary.

We also see that the error leaked through to the next test. Even though #17095 did in fact improve the situation (because I saw plenty of occurrences where the error did not leak through anymore) the one-second difference doesn't seem to always be enough in practice, and therefore needs to be tweaked a bit more. We can make it larger because if a single operations takes that long then hope for any success is already lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment