-
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
"run" is much slower than "open" #2912
Comments
Hey @cake-jnorman, to clarify, you ran |
@jennifer-shehane Apologies for the delay. I did as you asked and ran both
This surprises me since |
@jennifer-shehane any additional thoughts? can i get you any more information? |
I don't think this is Cypress specific - in fact in Run Mode we disable certain debugging features that actually have a much bigger performance impact in I think all of what you're experiencing here is simply the difference between Chromium 59 vs the latest version of Chrome. If you switched |
Also, it doesn't appear that you're comparing apples to apples here. You cannot compare your local machine with one in CI AND run them in two completely different modes AND completely different browsers. Do the same thing everywhere and then you'll see comparable results. Run Electron locally and compare:
Then run Chrome locally and compare:
Then run in CI:
Now you can compare each set's performance with the other. Mixing anything else isn't equivalent. Your CI machine is likely completely underpowered and that's why you're seeing such a large differential. Give it more resources and it'll improve. Please post your results. |
both instances were run on my local machine. nothing different between the two runs other than the command executed. I'll give your suggestions a go and get back to you. |
I am seeing this problem as well. Is there a reason that such an old version of Electron is being used? I'm not sure if upgrading will solve this problem but it seems like it is worth a shot. |
i do not think that it is electron per se, unless it has issues in headless mode. we ran both the headless and headed versions of the test framework on electron and the headless ran slower every single time, typically by a factor of 4 or 5. That's right, the headless version of the test suite is slower. i don't get it either. I've not had time to dig in more yet but i hope to get back to gathering some metrics soon. |
I had a similar case : headless testing was slower than run --browser chrome but it was due to video recording feature. Try add In my case, I only enable video recording in CI mode, but not for local runs. |
The video recording and uploading does add time to the end of each test file that is ran when |
same issue here, my test suite runs (both on local machine):
|
Cypress run is much slower than cypress open. Is anyone looking into this? Testcafe doesn't have this problem. |
This problem on my situation is mainly caused by So far, cypress seems not ready for chrome headless, is there a way to auto trigger |
After digging into some source codes of cypress, could we introduce an env like I thinks this can be an option to reduce run time on CI caused by browser relaunching. |
@cake-jnorman @fr0 @devdelpiero @andreasmihm Can you confirm if you are comparing the 2 situations below?
Explanation of why it is slower (this is expected behavior)
If this is the case, then we will close this issue and suggest you add your thoughts and 👍 to this issue: #2951 |
@jennifer-shehane I can also confirm the difference in speed between My impression is the same as @maple-leaf: Cypress relaunches the browser for each spec in the |
I'm experiencing the same issue, BTW, I'm using a MacBook Pro with macOS 10.14.5. |
As explained in #2912 (comment), there are some reasons why it may be slower - please read this comment and refer to the other issue if needed. Outside of this - we will need a reproducible example to prove Currently we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please comment in this issue with a reproducible example and we will reopen the issue. 🙏 |
I have the exact same issue (It wasn't always like that). cypress open with electron runs lightning-fast while cypress run (default electron) runs extremely slow. Perhaps it's worth mentioning that my colleagues are not suffering from this issue and that my mac's got 8GB of RAM while they have 16GB. (same dev env setup and cypress suite). I've also noticed that right after a fresh restart it gets better. So it might be resource related. I'll try to find anyone else with 8GB of RAM and see if I can isolate this one. |
The resources available on the system running the tests can most definitely result in a slower performance. This should always be investigated. |
yeah something changed. |
I can also confirm this. Run with |
Same for us, much more slower, resulting some tests are not passing with |
@tarponjargon @sergiomap @lugus Please comment in this issue with a reproducible example and we will reopen the issue. Also, show timing diffs from previous versions and current version - you can change Cypress versions quite quickly to prove this. |
Yes, we're being quite lazy ;) I will try to put together a test repo |
@tarponjargon @lugus @sergiomap Switching to Chrome solved this issue for me.
|
Right now for me each cypress |
I have a similar problem. After experimenting with both commands locally, these are the differences that I've noticed:
I called a Cypress command in Is there any built in solution to this? Don't see anything in https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html |
@JZebra No, we run all specfiles separately during We anticipate removing the 'Run all tests' functionality for several reasons, so recommend moving your workflow to the way |
I have the exact same problem. |
'cypress run' is very slower than previous versions, but 'cypress open' is faster when compared to cypress run. Few things I have tried to see if it makes the run faster: Like by setting the 'video' to false, number of retries to 1, earlier it was 2 and 'numTestsKeptInMemory' to 0, earlier it was 5, but no luck yet, still it is running very slow.
System configuration: OS: Windows 10 Pro Cypress configuration: Cypress version: 4.10.0 cypress.json: context('UAT Test Cases-High-1', () => {
beforeEach(() => {
cy.loadTokens();
cy.loginRequest();
})
it('Test 1', () => {
// rest of test steps follows here ...
})
it('Test 2', () => {
// rest of test steps follows here...
})
......
}) Docker output: |
This makes it ok for me. It does prompt electron but it automatically closes when the tests are finished. Tests drop from 50 to 1 second even with the video recording. Problem is possibly on not getting the native video. |
I am facing the same issue my tests are slower on Run and fail often but on Open the performance is quicker |
Is there an open issue for this? I'm also getting the same issue with 6.0.1. If I run all the specs using cypress open it takes 8 minutes, using cypress run with the same browser it can be take anywhere between 15-20 minutes |
I guess I'll just add another data point, same exact behavior for me. Mac OSX, pretty small test suite (12 spec files), using the Angular Cypress schematic. All the spec files are pretty small, 10/12 less than 50 lines and all of them less than 150 lines. Just absolutely UNBEARABLY slow when running in headless mode. Each spec individually takes 20-40 seconds, whereas using the GUI it's more like 5 seconds per spec, 10 at the most. In total it's like 2 minutes with the GUI, but in headless it was like 15 minutes at first. I managed to get it down like six minutes by disabling the videos and using dev build and whatnot, but it still doesn't make any sense Activity Monitor says the terminal process is using between 1-2 GB (goes up and down a lot) which seems pretty high to me. But I have 32GB, it's nowhere near capacity. |
@ShawnMercado can you give us a reproduction and open a new issue? We're currently investigating various performance issues. |
Wish I had time, maybe in a couple weeks. What I'm working on is complicated and under NDA so I'd have to build a full-but-vanilla version to have a good chance of a meaningful reproduction. Sorry I know that's not helpful :/ |
This seems like a bug - the headless version of the tests run 4x - 5x slower than the headed ones. (
cypress run
is about 4x-5x slower than the same tests run viacypress open
)Current behavior:
I have a test suite with 77 tests in it currently.
In local dev I have been using the open command, per the docs. The GUI is awesome, thank you for this. The ability to select one tests suite at a time to test on the fly is great. And when I run all tests at once, they run fun fairly quick. All 77 of them run in about 1:15. This is acceptable, especially considering all of the debugging tools that are available in this mode. But
cypress open
isn't the problem.We're working on getting a CI in place. In preparation for this, I ran the tests via
cypress run
as this is how I would expect our CI server to operate. I was (honestly) shocked to find that they were running 4x-5x slower in the headless electron browser. Tests routinely take at least 4:10 to complete in this mode. I've dug through other issues, google, docs, everything I could find and I have not found a way to speed this up (aside from running in parallel... which I don't feel addresses the real problem here).Desired behavior:
Tests run at last as fast vis
cypress run
as they do forcypress open
.Steps to reproduce: (app code and test code)
...This may be a little tough. The bug is not a specific 'this blew up' but more a 'this really seems like wrong behavior, at the top level'. But if you feel that I can provide something specific, please ask.
Versions
Cypress 3.1.3
Node 10.12.0
Yarn 1.9.4
MacOS X High Sierra
Chrom 71 (cypress open executing in this browser)
config:
Thank you!
The text was updated successfully, but these errors were encountered: