cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.54k stars 3.2k forks source link

Cypress video stuck when running on github actions #19488

Open Siegrift opened 2 years ago

Siegrift commented 2 years ago

Current behavior

Running cypress tests on github actions will always produce videos that are stuck in the first few seconds.

You can see the workflow details here: https://github.com/Siegrift/expense-manager/actions/runs/1631172697 Also the video:

https://user-images.githubusercontent.com/22679154/147588732-e3c4c8ab-092a-400e-aa6c-2d7a079f7beb.mp4

Desired behavior

The video should be recorded correctly.

Test code to reproduce

You can find the code in https://github.com/Siegrift/expense-manager/tree/simplify-ci-saved-for-issue

Cypress Version

9.2

Other

No response

dennisoelkers commented 2 years ago

I am seeing the same issue with 9.3.1 on Jenkins, video is stuck after ~15s.

cesarvarela commented 2 years ago

Same here:

https://dashboard.cypress.io/projects/1w1vze/runs/e7dd1be5-c8c1-456f-85be-ce362904aaad/test-results/800c8bab-2b70-4572-b625-f16a160ece81/video?utm_source=Dashboard&utm_medium=Share+URL&utm_campaign=Video

knutmarius commented 2 years ago

Same issue on v10.3.1 with GitLab. Video stops around 17 sec.

karlhorky commented 1 year ago

This is a known issue with Cypress - Cypress cannot take the videos on the default GitHub Actions machines:

Using the new GitHub Actions "larger runners" is an option, but this may be an undesirable extra cost:

https://github.com/cypress-io/github-action/issues/483#issuecomment-1310424019

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

karlhorky commented 1 year ago

Not stale

AtofStryker commented 1 year ago

I am attempting to create a reproduction repo to get something more narrowed down since the reproduction steps for the provided repo are fairly involved. I made a reproduction repository but I haven't been able to reproduce it as least looking at this video. Am I missing something?

karlhorky commented 1 year ago

@AtofStryker Not sure what you've tried with the workflow in this reproduction above, but this issue is about running Cypress on GitHub Actions (including video recording on GitHub Actions), not recording using the Cypress Dashboard.

AtofStryker commented 1 year ago

@karlhorky sorry I should have been more clear. Video should be on by default in the cypress config and that video is being persisted to the dashboard run, which seems to look OK?

https://github.com/cypress-io/cypress/assets/3980464/ca6b90df-61fb-44db-a5d0-61b247e43960

karlhorky commented 1 year ago

Ok, but unless I'm missing something, your comment and reproduction is unrelated to the issue which you are commenting on here.

This issue (#19488) has to do with recording video on GitHub Actions - not recording them on Cypress Dashboard.

Something closer to this:

      - name: Cypress Tests for Learning Platform
        uses: cypress-io/github-action@v4
      - uses: actions/upload-artifact@v3
        if: failure()
        with:
          name: cypress-videos
          path: cypress/videos
AtofStryker commented 1 year ago

@karlhorky I can give this a shot but It seems weird to me since the video is just compressed and then if dashboard recording is enabled just sent to the dashboard. I would expect uploading an artifact of the same video to be similar, but who knows and I'll try it out!

AtofStryker commented 1 year ago

I updated the test to upload the video artifact to github actions and no longer record to the dashboard. The result seems to be the same. Does it only happen on failures?

https://github.com/cypress-io/cypress/assets/3980464/1a8fe259-cd47-4d4b-99d7-4685e10a47af

sfc-gh-bgowin commented 1 year ago

I am seeing the same issue with 12.12.0 on Jenkins, video is stuck for first ~2 minutes. Im running this setup:

karlhorky commented 1 year ago

@AtofStryker I haven't dug into why the videos freeze, but they happen with real-world apps in most circumstances on the common GitHub Actions configuration (more links to other reports and details here).

Another idea is that maybe the kitchen sink example doesn't represent what real-world apps do most of the time.

In that case, I guess it would make sense to make a simple app that would be more common in the ecosystem eg:

  1. create a fullstack app with the latest Next.js version with at least 3 pages, including backend data fetching using either getServerSideProps (Pages Router) or React Server Components (App Router)
  2. create tests which navigates among the various pages and fills out a form, with 2+ errors
  3. maybe also experiment with adding a second app for an external API, eg. built with Express
mschile commented 1 year ago

I did observe the video getting "stuck" when viewing this video for the cypress-realworld-app that was recorded with a GitHub action.

I will forward this ticket to the appropriate team. They will evaluate the priority of this ticket and consider their capacity to pick it up. Please note that this does not guarantee that this issue will be resolved. The ticket will indicate any status changes. Thanks!