-
Notifications
You must be signed in to change notification settings - Fork 10k
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" #17021
Fix integration test "Interaction in autoprint.pdf must check if printing is triggered when the document is open" #17021
Conversation
This integration test fails often because we wait for scripting to be ready before we check the printed page, but most of the time the PDF is already done printing before scripting is reported to be ready. This happens because the print trigger is on the `Open` event, which is one of the first events to be dispatched and, most notably, before scripting is marked as ready; please see https://github.com/mozilla/pdf.js/blob/master/web/pdf_scripting_manager.js#L176-L191. Given that the PDF document is only one page, printing it is usually finished between triggering the `Open` event and scripting reported to be ready. If this happens the printed page is already destroyed before we get to our actual test, which will then timeout because it will never find the printed page in the DOM. This commit fixes the problem by not awaiting scripting to be ready because the fact that the printed page appears is already enough to know that autoprint was triggered (after all, there is no other user interaction involved here). While we're here we also switch to the shorter `page.waitForSelector` function.
/botio-linux integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/6b7d8c7f6465d62/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/6b7d8c7f6465d62/output.txt Total script time: 4.96 mins
|
/botio-linux integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/5f6231a3864a82e/output.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing code to fix a test is always nice :-)
r=me, the level of detail in the commit message is most helpful to understand the changes; thank you!
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/5f6231a3864a82e/output.txt Total script time: 5.08 mins
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/eaa22ddbb6154b6/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/bce1218dc5a041d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/eaa22ddbb6154b6/output.txt Total script time: 4.93 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/bce1218dc5a041d/output.txt Total script time: 20.36 mins
|
This is part 5 of the work to create tickets for and on a case-by-case basis fix intermittently failing integration tests.
The commit messages contain more information about the individual changes.
Fixes #16965.