-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Don't write an empty PDF file when downloading of a linked test file fails #7947
Don't write an empty PDF file when downloading of a linked test file fails #7947
Conversation
…fails Currently `test/downloadutils.js` will write out an empty file when downloading of a linked file fails. The consequence of this is that since the PDF file now "exists", no further attempts to download it will be made unless the empty PDF is removed. This is especially annoying when it happens on the bots, since it requires that someone logs in and manually removes the empty PDF file. I'm really not sure why it was implemented this way to begin with. However, given that `PDFJS.getDocument` fails with `MissingPDFException` if a file is not present, I cannot see a problem with this change. Furthermore, the patch also changes the `checkRefTestResults` in `test/test.js` such that we treat the "downloading of linked test file failed" case as a failure, so that e.g. the bots won't report "success" when a test file failed to download.
Given a nature of linked files, saving empty and error file was done to allow beginner contributor to at least continue with some subset of test. I would like to preserve this behavior in someor even relaxed form. We don't want to discourage people to use testing. For the server we can enforce failures for non-downloaded files. |
We need to disable these line for 'test'/'unittest' and keep it only for 'makeref'. https://github.com/mozilla/botio-files-pdfjs/blob/master/on_cmd_test.js#L80-L86 |
I can certainly revert the changes to Consider the way that things currently work, when one of these empty files are loaded it will trigger this So, without the change to |
In the past (test.py) it was done to suppress further attempts to download with subsequent test.py run, e.g. if you had multiple pdfs files failed to download, you could get several minutes of retry until testing will run. |
Can we split download of pdf corpus into separate task? If pdf were not downloaded it will just skip them with warning during testing. Download task will never create an error/empty file, and every time it will try to download missing pdfs and erroring if at least one fails. |
Yes, that definitely sounds like the best solution here! |
Currently
test/downloadutils.js
will write out an empty file when downloading of a linked file fails. The consequence of this is that since the PDF file now "exists", no further attempts to download it will be made unless the empty PDF is removed.This is especially annoying when it happens on the bots, since it requires that someone logs in and manually removes the empty PDF file.
I'm really not sure why it was implemented this way to begin with. However, given that
PDFJS.getDocument
fails withMissingPDFException
if a file is not present, I cannot see a problem with this change.Furthermore, the patch also changes the
checkRefTestResults
intest/test.js
such that we treat the "downloading of linked test file failed" case as a failure, so that e.g. the bots won't report "success" when a test file failed to download.