-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Reporting/Screenshots] Handle page setup errors and capture the page, don't fail the job #58683
Merged
tsullivan
merged 25 commits into
elastic:master
from
tsullivan:reporting/screenshot-always-capture
Mar 6, 2020
+724
−503
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d953b97
[Reporting] Handle error if intercepted request could not be continued
tsullivan 052dc3e
[Reporting/Screenshots] Handle page setup errors and capture the page…
tsullivan 32ec120
show warnings in UI
tsullivan 45ce509
i18n todos
tsullivan 7fe4001
Cleanup an old troubleshooting task
tsullivan bdc2ea7
set the default for all new timeout settings to 30 seconds
tsullivan d6fc7bc
fix some tests
tsullivan ad8579d
update error strings
tsullivan dd5d05f
Cleanup 2
tsullivan 7dc9e51
fix tests 2
tsullivan 12dc009
polish the job info map status items
tsullivan 535dd92
More error message updating
tsullivan 6eab0ab
Log the error that was caught
tsullivan 12679f5
Oops fix ts
tsullivan 86a9738
add documentation
tsullivan 606c1f1
Merge branch 'master' into reporting/screenshot-always-capture
tsullivan 4ce34f6
fix i18n
tsullivan 8ff5ced
fix mocha test
tsullivan fc9d418
Merge branch 'master' into reporting/screenshot-always-capture
tsullivan d8a3d0c
Merge branch 'master' into reporting/screenshot-always-capture
tsullivan 99066b2
Merge branch 'master' into reporting/screenshot-always-capture
tsullivan 926b694
use the openUrl timeout as the default for navigation
tsullivan 1723523
fix comment
tsullivan 01cb7e4
Merge branch 'master' into reporting/screenshot-always-capture
elasticmachine d514aee
Merge branch 'master' into reporting/screenshot-always-capture
tsullivan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
x-pack/legacy/plugins/reporting/__snapshots__/index.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/check_for_toast.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note: These get passed to Puppeteer
waitForSelector
calls. Puppeteer's default for these is 30 seconds internally.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.
I think we do call https://pptr.dev/#?product=Puppeteer&version=v2.1.1&show=api-pagesetdefaulttimeouttimeout and pass in the overall job timeout, so we might be overriding the default timeouts for these APIS.
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.
Yup, we do it here: https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/index.ts#L120. Maybe we just default these to the global job timeout in this case?
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.
++ If we're passing the timeout to each of the calls, then setting
page.setDefaultTimeout
doesn't make a lot of sense.I don't think we should use the global job timeout, which is the "queue timeout" because once that timeout hits there is no buffer room to recover a completed screenshot for the job. Hitting the "queue timeout" should be avoided as much as possible.
We need to think about this... Should the
page.setDefaultTimeout
be the max of these 3 new timeouts?At any rate,
server/browsers/chromium/driver_factory/index.ts#L120
is no longer valid in this PRThere 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.
@joelgriffith wdyt about the changes in 926b694 ?
specifically 926b694#diff-874db4343510c2d0fb661b14af4a97e9R115
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.
Yup, this makes sense:
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.
Individual methods can still override this, but I like setting it to the
openUrl
which is where I think the bulk of the operation is for PDF reports