-
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
Single-machine parallel execution occasionally results in "not a function" errors #19565
Comments
Hi @j1000, we currently don't support running multiple instances of cypress in the same project on the same machine at the same time. It can cause weird interactions (as you've run into). You could take a look at splitting this up to run in several docker containers in parallel, but i can't promise it's a faster solution. Sorry. |
Gotcha, thanks. This is a shame, because it used to work without issue. I'm not sure if Cypress changed or if my tests changed. |
@mjhenkes I think I have a viable workaround for this. If you launch the tests with the configuration value |
After some time using this workaround, it's not a cure but it seems to make a huge difference. I was getting 3-6 "is not a function" failures with every run before; now I'm getting 0-1. Usually 0. I'll learn Docker eventually but this works for now ;) |
Thank you very much for this. Makes my tests far less flaky too. |
Current behavior
I have a weird intermittent failure that only happens when I run the tests in parallel on my local machine (using a Powershell script). Out of ~200 tests about 5 will fail, and it's never the same tests. The error is always "__ is not a function" where __ is one of my Cypress custom commands. It seems as if there's a race condition happening in Cypress's code, and the spec file is loading before /support/index.js has been loaded. (Maybe there's a file permission issue due to all the threads accessing the same stuff?)
Desired behavior
Ideally the bundling would work consistently and /support/index.js will always be properly loaded for each spec file. But alternatively it would be nice if test reruns reloaded (and rebundled) the spec file entirely so that the test doesn't fail upon rerun.
Test code to reproduce
I wish it were simple to reproduce. You need any large set of tests running in parallel locally. I am on a Windows 10 workstation. I'll give you my Powershell script in case that helps.
Cypress Version
9.2.0
Other
No response
The text was updated successfully, but these errors were encountered: