-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Screenshot file name too long warning when Bytes exceeded #2403
Screenshot file name too long warning when Bytes exceeded #2403
Comments
Thanks for reporting this. We definitely need to catch that error and truncate the file name as needed. I'm hesitant to always truncate at an arbitrary character length since that's going to be OS-dependent and there may be an operating system with an even lower limit. Speaking of which, on what operating system are you encountering this? Unfortunately, there's no way to change the screenshot path before it's written to disk. We'd need to add a new plugin event that enables that. |
Thank's for response @chrisbreiding , we are running on Ubuntu 16, Ubuntu 18 and Docker image cypress/browsers:chrome67 |
This comment has been minimized.
This comment has been minimized.
1 similar comment
+1 |
I also got this issue on our internal tests. 🙈
|
I got the same situation with 3.2.0 version. @lilaconlee Can you please look here?
|
@AlDemion Thanks so much for providing the logs. I tested nesting some long suite titles, which passed for me. I then tried pasting in the exact titles of your test suites - this also passed for me. I changed the filename, so that the path would be really long - this also passed for me! So, I haven't been able to recreate completely with my guesswork. Can you post the full |
Hello! I've come across with the issue that even after Cypress truncate extra letters from file name I still get ENAMETOOLONG error in CI. I figured out that the cause of that is using Cyrillic letters in Cypress tests.
So it happens that file name with Cyrillic letter pass the Cypress validation but not file system validation. @AlDemion maybe you have the same issue. I've checked how many characters vs bytes in your example in apfs:
Logs 164
Logs 268 And it seems that your filename might actually exceed your filesystem limits |
@kuznetsovaOk Thanks for the explanation @kuznetsovaOk, this is amazing, thank you! The max filename length is dependent on the file system that Cypress would be running in and all of them are listed here: https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits But yeah, I think the key takeaway here is that chars !== bytes. Reopening to address bytes issues. |
When is this issue expected to be resolved? This is a breaking issue for build pipelines so should be seen as a high priority. Not sure why in over a year it hasn't yet been fixed! |
Yeah @kuznetsovaOk You got the point. It seems that all the problems in the file system limits. But I can't change the filesystem, so one hope is that the issue will be fixed by truncating the filename or by using a randomly generated string for the screenshot name. |
The patch should be simple enough, if someone having this issue wants to open a PR. We most likely just need to use
|
We're running into this in the
A total of 260 characters. Is there any workaround? |
The original issue opened by @rafaelcaviquioli was fixed, by this PR: #2635 The issue @AlDemion and @kuznetsovaOk are running in to seems to be caused by the difference between I've opened a PR that truncates filenames to a maximum of bytes on all operating systems. @jbergknoff-rival you can try building from my PR and see if it fixes your issue, or if you want, you can share the filenames that are causing problems and I can try to see. Any Unicode character could cause this problem. If you don't have any Unicode in your filenames, could you also share debug logs from the time that issue occurs? |
The code for this is done in cypress-io/cypress#8175, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
Currently I use BDD to document acceptance test cases, each test scenario is well detailed, Cypress uses the description of "it" to create the screenshot file name, but when "it" exceeds 255 characters it is not possible to create the screenshot file.
Desired behavior:
Steps to reproduce:
Versions
Cypress: 3.0.3
Browser: Chrome 67
The text was updated successfully, but these errors were encountered: