question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"run" is much slower than "open"

See original GitHub issue

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 via cypress 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 for cypress 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:

{
  "integrationFolder": "src/app/components/_pages/", // we keep tests with their corresponding component
  "testFiles": "**/*.int.spec.js", // as a result, we had to easily denote cypress tests
  "baseUrl": "http://localhost:3000/",
  "video": false,
  "chromeWebSecurity": false
}

Thank you!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:19
  • Comments:38 (10 by maintainers)

github_iconTop GitHub Comments

9reactions
blumkcommented, Dec 14, 2019

@tarponjargon @lugus @sergiomap Switching to Chrome solved this issue for me. Chrome runs about 4x faster than Electron on my machine.

cypress run --headless --browser chrome

7reactions
maple-leafcommented, Apr 11, 2019

After digging into some source codes of cypress, could we introduce an env like autoRunAll for open, and check this env at specs.jsx file when it gui ready, If it’s true, then auto trigger run all Specs.

I thinks this can be an option to reduce run time on CI caused by browser relaunching.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Am I Running Slower? 14 Reasons You're Running Slow
Running too much mileage could actually cause you to start running slower – due to something called overtraining syndrome.
Read more >
Run Slower to Become Faster: Why It Works and How to Start
Running slow always means that you're running in the aerobic zone or in oxygen. In oxygen is a running pace less than 80%...
Read more >
Run Slow to Run Fast - Real Life Runners
Running slower to become a better runner may seem counterintuitive, but it's a scientifically backed method to run faster and farther.
Read more >
9 Reasons You're Running Slow
Common Reasons Why You are Running Slow · Not getting enough quality sleep. · Experiencing too much stress. · Not eating enough calories....
Read more >
The BIG Problem With Running Slow to Run Faster ... - YouTube
If you're currently following a " run slow to run fast" plan, consider making these adjustments to your run training to increase your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found