-
Notifications
You must be signed in to change notification settings - Fork 29
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
HTML2PDF: System chromedriver for PDF export #1932
HTML2PDF: System chromedriver for PDF export #1932
Conversation
9d1e763
to
db27dcd
Compare
3bd83ff
to
5a72cee
Compare
@stanislaw Sorry if these CI debug trials cause E-Mail spam at your side. I try to figure out why $CHROMEWEBDRIVER (defined by GitHub CI image) is not passed into lit in the tox py37 env, while it works in py312 env. EDIT: I think it's solved now, thanks to a former stackoverflow answer of yours. I thought this snippet from LLVM guide
meant one could use |
1ed0ac8
to
0716f2c
Compare
e2e test |
Yeah, that seems to be a rather rare flaky test. I recorded it in the code climate ticket. For now, just restart.
No worries at all! I am happy to see all the updates, including CI. I am glad that you figured it out for LIT. Overall, your approach looks good but I will see if I have any specific comments. |
0716f2c
to
6dd0389
Compare
@haxtibal the tests like this one I often get an impression that SeleniumBase/Selenium receive updates to their logic and this makes some of these flaky tests to re-surface and start failing more often. Right now it looks like these errors have nothing to do with your branch. I recorded all of these in the code climate and should investigate them, otherwise we will get blocked all the time in the future. |
One reason that used to plague a lot of the end2end tests used to be a generic HTTP 500 Web Driver Exception. A solution to this error in that case was to implement a retry mechanism, catching this 500 error. After that, you can very often see in the build logs that this machine actually works all the time, catching these 500 errors. I think this may be the only strategy that actually works: catch and retry, two times. |
This is the one I was talking about. It is right there in the failing job:
|
SeleniumBase has retry logic built in and we see it in action. The failing exception happens in this code path, which is already the retry of a retry, IIUC. Any ideas how to reproduce this for debugging, or get good debug information? Ideally we could attach into a running gh runner session, but not sure if that's possible at all. Or maybe making a browser screenshot right before the failing test statement, or dumping the DOM state... |
I cannot check this right now. What I normally do is to explore the context around the failing line very carefully and try to add intermediate checks or add the retry logic. No silver bullets in my pocket. Looking at the number of the tests randomly failing, I assume SeleniumBase/Selenium received an update that changed logic/timing and this revealed the existing weaknesses in the tests that are currently failing. |
I'll revert the last debug commit to set the PR in a reviewable/functional state. And then will do experiments regarding the failing test in a separate branch or personal repository. Debug your GitHub Actions by using ssh sounds interesting. |
ffe93a2
to
6dd0389
Compare
PDF export requires chrome/chromedriver. Currently StrictDoc always uses webdriver_manager to download a suitable chromedriver and install in a strictdoc cache subdirectory. There may be reasons to prefer a system installation over an adhoc download (e.g. security policy). Notably Debian provides packages that work out-of-the-box for StrictDoc. GitHub Ubuntu CI images have the upstream version pre installed. This adds an CLI option --chromedriver to select an explicit chromedriver. If not given, strictdoc uses webdriver_manager as usual. To use the Debian package, one would call apt install chromium chromium-driver strictdoc export --fromats=html2pdf --chromedriver=/usr/bin/chromedriver . To use chromedriver from GitHub Ubuntu image, one would call strictdoc export --fromats=html2pdf --chromedriver=$CHROMEWEBDRIVER .
6dd0389
to
8b651d8
Compare
PDF export requires chrome/chromedriver. Currently StrictDoc always uses
webdriver_manager
to download a suitable chromedriver and install in a strictdoc cache subdirectory.There may be reasons to prefer a system installation over an adhoc download (e.g. security policy). Notably Debian provides packages that work out-of-the-box for StrictDoc. GitHub Ubuntu CI images have the upstream version pre installed.
This adds an CLI option
--chromedriver
to select an explicit chromedriver. If not given, strictdoc useswebdriver_manager
as usual.To use the Debian package, one would call
To use chromedriver from GitHub Ubuntu image, one would call