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

JSON output gets cut off on large HTML files on Ubuntu 22.04 #9

Closed
AydinE opened this issue May 8, 2024 · 6 comments
Closed

JSON output gets cut off on large HTML files on Ubuntu 22.04 #9

AydinE opened this issue May 8, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@AydinE
Copy link

AydinE commented May 8, 2024

Hello,

I recently came across this issue working on https://github.com/Lombiq/UI-Testing-Toolbox/pull/364/files

When setting OutputFormatter or ResultFileFormatter to JSON the Output and/or ResultFile gets cut off when the source objects gets too large.

This was not happening for me locally on Windows and only appeared during testing in our GitHub action on an Ubuntu runner. After trying to reproduce this locally on Ubuntu I had the same issue, so this definitely does not seem to be happening on Windows at all but only on Ubuntu 22.04 (And possibly other distros but this is the only one tested for now).

For now we have a small workaround to add missing tokens back to the JSON before parsing since we don't really care about the source object anyway but would love to hear if there is a better solution for this. https://github.com/Lombiq/UI-Testing-Toolbox/pull/364/files#diff-67847fe58db929ae56cd24e4ba914c28af919cdf0272fd3cbf193c995d2666aeR39

@YevgeniyShunevych
Copy link
Member

Hello,

I would to like to have more details on this one if possible.

Output and/or ResultFile gets cut off when the source objects gets too large.

How large? Can you please provide some example to be able to reproduce such case? Ideally it would be great to have the HTML being tested and the .htmlvalidate.json used. I'm also interested in HtmlValidationOptions.HtmlValidatePackageVersion value.

I can also assume that the problem might be in html-validate package which is used under the hood of Atata.HtmlValidation. Basically, if you'll be able to reproduce the broken output file using html-validate CLI, then problem is definitely there, and you can post that issue into their repository.

@AydinE
Copy link
Author

AydinE commented May 10, 2024

Hey @YevgeniyShunevych ,

For some context I have created a small test project that demonstrates the issue. For this test I just loaded in some html from the reddit frontpage but it happened to us during testing with much smaller pages as well.

The cutoff on the JSON output and/or file seems to be at 64KB since all of the tests that I run the output comes out at exactly 64KB or 65536 characters are read from the output until it's cut off.

I have also tried running html-validate directly from the package on the same file using html-validate --formatter=json reddit-frontpage.html and I don't seem to have the problem there that's why I have posted it here.

Just a recap: This seems to happen only on Ubuntu (perhaps other distros too) but not on windows, I have provided no specific options for the .htmlvalidate.json or HtmlValidationOptions.HtmlValidatePackageVersion. The sample repo I made should cover everything and demonstrate the issue.

https://github.com/AydinE/HtmlValidateTest

@YevgeniyShunevych
Copy link
Member

Thanks @AydinE for the sample repository. I am able to reproduce this issue. Investigating. Will get back to you with a solution.

@YevgeniyShunevych
Copy link
Member

Hey @AydinE. I've just released v3.1.0 of Atata.HtmlValidation with a fix for this issue. Please verify it on your side.

@AydinE
Copy link
Author

AydinE commented May 22, 2024

Hey @AydinE. I've just released v3.1.0 of Atata.HtmlValidation with a fix for this issue. Please verify it on your side.

I just tested it today on Ubuntu again and it does indeed seem like there is no more cutoff using the new version.
Thanks for the fix!

@YevgeniyShunevych
Copy link
Member

Great, closing the issue then.

@YevgeniyShunevych YevgeniyShunevych added the bug Something isn't working label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants