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.

Testing via Github Actions -- Cypress runner takes 20x longer to run than local and Videos aren't watchable

See original GitHub issue

Current behavior

Description: We are trying to run Cypress and Percy together via Github actions to test our app during development for (Sketchy)

The test runs are taking a really long time (~20 mins) when our expectations are that they should be done in less than 4 and perhaps 1 if we ran in parallel. We are also noticing that the video recordings are not watchable (they don’t show the recorded flow of the test they just show a couple snapshot states). We have experimented with changing the compression levels of the videos to no avail.

Here is a link to one of the test runs where it was slow: https://dashboard.cypress.io/projects/pfwmze/runs/111/specs

I also commented here: and here

The major issue, outside of build time, is that Github actions only offers a certain amount of mins per month in non-enterprise scenarios and these tests are massively eating into those mins and our build times even though they finish locally in under a min.

I’ve attached a photo showing how the specs themselves are running quickly but the total test run is very long.

Cypress_Test_Run_Long_Time

Desired behavior

The tests run as fast in CI (headless) as they do locally and perhaps even faster if we run them in parallel.

Test code to reproduce

Link to part of my config is here:

This shows what my memory/cpu looks like during test run: https://github.com/cypress-io/cypress/issues/16884#issuecomment-1045937281

Here is my config file setting:

{
  "projectId": "xxxxx",
  "defaultCommandTimeout": 10000,
  "chromeWebSecurity": false,
  "videoCompression": false,
  "viewportWidth": 1440,
  "viewportHeight": 900,
  "baseUrl": "http://dashboard.sketchy-premerge.com",
  "supportFile": "cypress/support/index.js",
  "experimentalSessionSupport": true
}

Here is how it’s being run in CI:

      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          browser: chrome
          install: false
          config-file: 'cypress/cypress.${{ needs.deploy.outputs.env_check_env_name }}.json'
          wait-on: 'https://${{ needs.deploy.outputs.env_check_sanitized_url }}.sketchy-${{ needs.deploy.outputs.env_check_env_name }}.com'
          record: true
          headless: true
          parallel: false
          command-prefix: 'percy exec -- npx'
          tag: ${{ github.event_name }}

Cypress Version

9.5.1

Other

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
josh803316commented, Nov 8, 2022

I agree @liambutler and it’s extremely frustrating not being able to use it. Just FYI: I was able to get this working again by using self-hosted runners and switching to the amazon linux 2022 image, although that is likely not an option for most.

0reactions
liambutlercommented, Nov 8, 2022

Cypress’ recommendation for minimum CPUs is 2, but then if you want video recording you should add in a third CPU.

Unfortunately, that exceeds the default GitHub Action runners’ specs: Screenshot 2022-10-17 at 11 41 43 (source)

Given how much documentation there is regarding Cypress running on GitHub Actions, I’d hope Cypress would be able to run smoothly in its default state (ie with video enabled). I don’t think there’s much appetite to go self-hosted on my team as no one wants the additional overhead. Tradeoffs everywhere I look 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing via Github Actions -- Cypress runner takes 20x longer ...
Testing via Github Actions -- Cypress runner takes 20x longer to run than local and Videos aren't watchable #3628. Sign in to view...
Read more >
Cypress is running really slow after upgrading to v10 #22868
Now the test execution time takes too long. This appears to occur when loading a page. Just the cypress package and cypress.config.js file ......
Read more >
Recording tests on the dashboard seems not to be working as ...
Testing via Github Actions -- Cypress runner takes 20x longer to run than local and Videos aren't watchable #20468. Open. @cypress-bot ...
Read more >
unusually slow tests & unplayable videos after upgrading to 8.7
1 to 8.7.0, tests started running extremely slow in CI. previously a run was about 15 minutes, now it takes over 30 minutes...
Read more >
Cypress always times out on Github Actions [Help Request]
Outside of opening a PR without my cypress.yml, and then putti. ... tests - name: Cypress run uses: cypress-io/github-action@v2 with: quiet: ...
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