-
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
Change in test file crashes component tests after upgrading to Mac #24398
Comments
Hi @will-weiss, we will try to reproduce this on our side. In the mean time, a bit of a guess: in my personal experience with Mac upgrades recently, I have seen file and folder permissions get weirdly messed up. Since you are hitting Curious if running |
Hi @marktnoonan I encountered the same issue. I did what you suggested and ran the following commands: I get the same error:
I checked the premissions for that exact file running
Trying to change the permissions of that file does not work either. I tried it with sudo as well doing
When I check the permissions in Finder however, the permissions are set to |
@will-weiss Thank you for providing the update and error logs. |
Hi @amehta265 I tried to create a small reproduction, but if I create a new project with the same setup (for me it is an NX angular project with component testing enabled), then I cannot reproduce the issue, so I started debugging the differences. For reference:
Sadly I cannot share the old repository with you, since it is a private repository and the reproduction repository does not cause this error. :( I do have a workaround for that repository, namely to manually comment out the |
@TapaiBalazs Thank you for trying to make a reproduction and sharing the differences in the old and new repositories. |
I wonder if you launch Cypress with sudo does it make a difference? Obviously not a real solution, but it would be one way to verify it's definitely a permissions issue. We need If someone who can reproduce this wanted to explore some other API to touch the browser.js file, that would be a good way to debug. I suspect the problem will happen regardless of how you touch that file, though, since it's a permissions issue (from what I can see). In the meantime, I wonder if we should just add a |
@lmiller1990 Thank you for your input! Based on that I was able to create a reproduction: See the video: Which I also uploaded to this reproduction repository: https://github.com/TapaiBalazs/cypress_24398_repro Please let me know if I can help you further So, in my opinion, there are two issues at play here:
When I run the command with sudo, the same issue happens, that's why I think the issue has something to do with the new MacOS version. |
@TapaiBalazs Thank you for providing a reproducible example. The issue on my MacOS Ventura is that This is definitely not a permanent solution but is merely an explanation and a work around without having to manually comment out the code in your bundled files. Let me know if this solution works for you. |
@amehta265 I use Webstorm, but I can confirm that when I added it to the full disk access list in the settings, the issue is not present anymore. Although, I do wonder how good of an idea it is to give full disk access to an IDE. 🤔 |
@TapaiBalazs I agree with you that giving full disk access to an IDE is definitely not a permanent solution and is merely a workaround. Cypress needs access to folders and files in this path We will definitely be looking into a more permanent solution but I'm glad we have a work around for now. |
Yes I understand, thank you very much for everything! :) |
Running with sudo makes this go away |
Just to add that in my case I'm running Cypress from my terminal, and running with sudo doesn't solve the problem. In addition to when creating a new spec file, this also happens almost every time an existing file is saved. Providing my terminal with full disk access did solve the problem as mentioned. However, it seems like trying again in 12.2, the error is caught and doesn't crash Cypress, but providing full disk access no longer resolves the issue, and the test window needs to be closed and opened again from the E2E / Component screen. |
@amehta265 thank you! after of couple of hours searching for issue and pulling my hair from head, your reply fixed my problem, appreciate that ! :) It was exactly like you wrote, after update to |
Some debugging here: #24876 that should help, potentially same issue (both having permission issues on Ventura). |
I have this too, but it is not consistent. I got an error and I hit "try again" and it worked. ???? Anything in Only impacting webpack, since vite does not try to write to the file system. If we can remove https://github.com/cypress-io/cypress/blob/develop/npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts#L113 we could avoid this all together. Without that line, new specs are not added to the webpack bundle according to https://github.com/cypress-io/cypress/blob/develop/npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts#L95-L100. Worth seeing if we can "trick" webpack into re-bundling when a new spec file is added. |
This is weird - why on earth would this fix it! Strange. |
@lmiller1990 If memory serves, when I had a similar issue after a (non-Ventura) upgrade, I found an ancestor folder that had readonly permissions that were inherited by folders that otherwise looked to have fine permissions, and things worked nomally after deleting that ancestor and re-installing (possibly |
Update... @astone123 reports:
The Explains why this MacOS specific, but not why we cannot write there. According to stack exchange:
Maybe we can use this info somehow? We could detect the OS and make sure this file is writable (and add/remove/change the xattr correctly). |
I wonder if Cypress (and |
For anyone else who comes across this, the only way that I could get this to go away is by editing the permissions for It doesn't seem to matter what exactly I change, but in my case what I did was
Like Lachlan said, you'll now see the permissions in terminal as This is only a workaround until we can find a way to either stop editing this file or fix the permissions issue with the way that we package the application. Not sure why this is only happening on Ventura |
Not sure if it helps but I was able to finally solve this (absurdly annoying) issue by adding my Terminal and IDE (IntelliJ) to the "App Managemet" Setting which will enable these apps to update or delete other apps. I added both apps because this is where I start my tests from. Just to mention, I got this error almost every time I change code. Now it's working for hours since 👻 MacBook Pro Settings > Privacy & Security > App Management (Section Privacy) |
I did a similar thing as @gearsdigital did. For me, it was the terminal that I had to add to the list of applications that can update or delete other applications: Now the error went away. My mac specs: |
Still working fine for me... Had the runner open almost the whole day and no issues so far. |
That would explain why I didn't have these issues recently, thanks for the report @gearsdigital - I recently got a new computer with Ventura. Somewhere in the flow of setting up I agreed these permissions, I just checked, and it's exactly as you said, terminal + IDE. |
@marktnoonan That is exactly what I did yesterday after my Terminal asked me for that very permisson – right after I started the cypress test runner. But now I'm afraid to revoke this permssions just for verifying this issue because everything runs smoothly now 🙈 Anyhow, I just did that and fiddled around a bit and I can confirm that the issue is back after revoking those permissions. After regranting, the issue is gone again. So it's reproducible now I guess. |
Yeah I think that what happens here is that the application that open the Cypress application needs to have the right to update or delete other applications because there is something inside the Cypress application files that need to be changed or looked at when component tests are running. If the thing that is changing or is checked against would live outside of the |
I think we've got a fix, please wait a few days, @astone123 will post a PR. |
This fix is in Cypress 12.7 - let us know if you are still having issues. |
I didn't use to have this issue, but I have encountered it after upgrading to 12.7.
Cypress starts ok, but crashes after I change some spec file. |
@scebotari66 thanks for this - taking a guess at a glance here, is the Although initially that doesn't look it should be a problem 🤔 |
@marktnoonan, here is how it's set: But as you have mentioned, this might not be the issue, since it works on Cypress start. It only crashes after I update a spec file. |
@scebotari66 could you share the absolute path to |
@marktnoonan, sure. It is |
@scebotari66 thanks. If you remove the I can see that the path which errors in your log ( |
@marktnoonan, if I remove
Maybe it's relevant, I have the following script for starting cypress: |
I had the same problem with Cypress 10.10.0 |
Ugh @scebotari66 I see, you get double I feel like we have enough to open a new issue around correctly getting the path to If you switch down to v12.6.0 does this problem go away? |
@marktnoonan, with v12.6.0 I get the same error as above when removing |
Current behavior
Hello! Thanks in advance for your assistance with this issue.
After I updated to Mac Ventura, I started seeing that any change to my test file crashes my open component tests as can be seen in the attached video. Changes to the non-test code does not crash the component tests.
demo.mov
ChromeChrome 106
360x760
(92%)
Desired behavior
In this situation, cypress should stay open after updating my test file
Test code to reproduce
Tests are run via
on version
10.11.0
.with a cypress.config.ts file that looks like this
The text was updated successfully, but these errors were encountered: