-
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
cy.visit
in 3.3.1 is 2x-4x as slow as 3.2.0
#4313
Comments
I tried downgrading from 3.3.1 to 3.2.0 and my tests once again ran faster (under 2 hours). |
Hey @fr0, are you using the built-in Electron browser? Do you have a proxy set up? |
Thanks for the quick response. I am using the built-in Electron browser, but I don't have a proxy set up. |
This could be a related issue to #4298 - does your app rely on any kind of non-200 status code, any redirects or anything like that? |
It doesn't, but that's a good thought. It does make heavy use of WebSockets. Also, my tests rely on some setup pre-work that calls that WebSocket API from the I'm not sure if any of that is related, though. Is there any additional logging I can turn on that would help to debug this issue? I'd love to send you guys the code so you can reproduce it, but unfortunately it's all proprietary (including the back-end). |
I guess technically the WebSocket upgrade is a |
You can get full debug logs by following these steps and share it to shed some light on the issue: https://docs.cypress.io/guides/guides/debugging.html#Print-DEBUG-logs That will help to debug the issue. Make sure to scrub any sensitive data before sharing them. |
This is just with a single spec file, but it's more than enough to show off the difference (59 seconds in 3.2 vs 114sec in 3.3.1). |
We've updated to 3.3.1 from 3.1.5 and we're also seeing this behavior. Things are much slower when running our tests in |
We're triangulating a few different issues in the |
We are seeing same behavior when upgraded from 3.2.0 |
This is a major problem for us. |
@nthum @ChuckOp @exan-atsui Hey, thanks for letting us know. Can you provide some additional details to help us debug? What operating system are you using? Are you on Cypress 3.3.1 or 3.3.0? Are you behind a proxy? What browser are you using? |
@flotwig We are running 3.3.1 on Windows 10 & using headless electron. We don't have proxy |
I am fairly certain that this is not OS-specific, as I've seen it both on Windows 10 and Mac OS. |
I wrote a small test case to benchmark cy.visit: describe '', ->
it 'benchmark cy.visit', ->
Cypress._.times 100, ->
cy.visit('/index2.html')
cy.wrap -> In Cypress 3.2.0, this executes in 17.25 seconds. In Cypress 3.3.1, this executes in 61.58 (!) seconds. So it does look like the issue is with Looks like #4349 is a duplicate of this issue, then. I'll close that issue and log future progress on tracking down the |
cy.visit
in 3.3.1 is 2x-4x as slow as 3.2.0
good idea to create a performance test like this, and the video shows a
weird "fast - slow" visit pattern, like you have noticed. Some time ago I
did an experiment where I timed the load of a page multiple times to see if
Cypress can give us performance metrics - the very first load was really
slow, but then it would quickly drop, but I have not noticed increased
times. I wonder if there is some browser cache getting full then cleared,
causing new full fetch. Or could it be connected to garbage collection
pause? We can also record and dump timings from Electron vs Chrome to see
if the same behavior is noticeable
Gleb
…On Tue, Jun 4, 2019 at 2:40 PM Zach Bloomquist ***@***.***> wrote:
I wrote a small test case to benchmark cy.visit:
describe '', ->
it 'benchmark cy.visit', ->
Cypress._.times 100, ->
cy.visit('/index2.html')
cy.wrap ->
In Cypress 3.2.0, this executes in 17.25 seconds.
In Cypress 3.3.1, this executes in 61.58 (!) seconds.
So it does look like the issue is with cy.visit(). I recorded a short
video of the benchmark which shows that every few cy.visit()s, it seems
to hang for a couple of seconds before continuing:
https://drive.google.com/file/d/15a26L9dC9EQHFJKd-hQfvxkxMnFgmPmN/view?usp=sharing
Looks like #4349 <#4349> is a
duplicate of this issue, then. I'll close that issue and log future
progress on tracking down the cy.visit slowness here.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4313?email_source=notifications&email_token=AAQ4BJQR2CKXYL735U4FGEDPY2ZKDA5CNFSM4HPRVP32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW5PUOQ#issuecomment-498793018>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQ4BJU6DS7J5B3A7M4XT2DPY2ZKDANCNFSM4HPRVP3Q>
.
--
Dr. Gleb Bahmutov, PhD
Schedule video chat / phone call / meeting with me via
https://calendly.com/bahmutov
[email protected] @bahmutov <https://twitter.com/@bahmutov>
https://glebbahmutov.com/ https://glebbahmutov.com/blog
https://github.com/bahmutov
|
Hi |
@danceric0919 We have a fix in place, it will be out with the next patch release (3.3.2). |
The code for this is done in cypress-io/cypress#4385, but has yet to be released. |
Would it be possible to create a beta release in |
@fr0 You can use the latest beta build for Windows: In Git bash:
In other shells, you'll need
|
I tried that, and at first it looked promising:
But then when I actually tried to run...
|
Oh! I thought you were running on Windows, sorry. Here's the correct command for macOS:
You might have to delete I know it's kinda a mess, we're working on making this more accessible to end-users. |
|
yeah @fr0 , we just don't want to pollute NPM with 10k builds of Cypress per month (like TypeScript), and that's why we take advantage of static folders to install pre-release builds. But we know some tricks to make it simpler, just did not get to implement them yet |
You definitely don't want to publish every single CI build as a pre-release to npm, true. Back on-topic: At first glance, the nightly build looks like it did not fix my issue. I'll try again on a different environment to be sure. |
@fr0 i think the PR that's going to fix your issue hasn't been merged into When you see that get merged in then you can see if it fixes your problem. |
Thanks, I'll take a look. Is there a way to get the cdn beta link for a given |
I tried the latest build (from c7b340) and the issue is not resolved. EDIT: Looks like I did get back some performance, but it's definitely still slower than 3.2.0. |
@fr0 Could you share spec code that reproduces the slowness that changed between 3.2.0 and 3.3.2? We had some test cases where we improved test performance (like the 100x cy.visit test I posted earlier in this thread, which now runs as fast as it did in 3.2.0), but it's possible that we missed an edge case that you're still running in to. |
Sure, I'll work on trying to get a reproducible example. |
I was able to reproduce the problem with the most trivial example I can think of that uses Angular + Cypress. https://github.com/fr0/cypress-slowdown Here's the spec file. https://github.com/fr0/cypress-slowdown/blob/master/cypress/integration/sample.spec.ts (It repeats 50 times just to get a bigger sample set.) Note that the problem isn't in (Note: I created a Thanks! |
@fr0 Thank you for the example repo, I see exactly what you mean now. After some debugging, I think you're having the same issue as #4411, check out this comment to see what I mean. If so we can move future discussion of this non- |
Excellent, thanks for the update. Glad you were able to reproduce it with my repo. FYI, I (any many others) are not able to roll back to 3.2.0 because it isn't compatible with Angular 8 (due to #2069 + TypeStrong/ts-loader#929), so that's not an option right now. I'll continue discussion in the issue you linked. Thanks again! |
Released in |
Current behavior:
Running my tests in 3.2.0 takes 1 hour 54 minutes.
Running my tests in 3.3.1 takes 4 hours 41 minutes.
(This is running on headless electron using
cypress.run
with the module API; I haven't measured it withcypress open
).Both cases are running on the same WIndows 10 VM, and not using parallelization.
Desired behavior:
I'd like my tests to take less than 2 hours.
Versions
Cypress 3.3.1
The text was updated successfully, but these errors were encountered: