Skip to content
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

Video process never exits - continues writing frames even after browser process killed #5415

Closed
jennifer-shehane opened this issue Oct 22, 2019 · 7 comments
Labels
CI General issues involving running in a CI provider stage: needs investigating Someone from Cypress needs to look at this topic: video 📹 type: bug

Comments

@jennifer-shehane
Copy link
Member

Current behavior:

There are some circumstances where the video recording will continue writing even after the specfile is finished and the browser process is killed.

The log below is an example. The writing video frame and video stream drained logging goes on forever until the main CI process times out.

mochawesome Report JSON saved to /app/mochawesome-report/mochawesome_003.json

  cypress:server:video:frames writing video frame +112ms
  cypress:server:video:frames video stream drained +0ms

  (Results)

   ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 
   │  Tests:        6                                              │
   │  Passing:      4                                              │
   │  Failing:      1                                              │
   │  Pending:      1                                              │
   │  Skipped:      0                                              │
   │  Screenshots:  1                                              │
   │  Video:        true                                           │
   │  Duration:     1 minute, 9 seconds                            │
   │  Estimated:    43 seconds                                     │
   │  Spec Ran:     spec.js                                        │
   └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 

  (Screenshots)

  - /app/cypress/screenshots/spec.js/Test (failed).png  (1280x720)

  cypress:server:run attempting to close the browser 
  cypress:server:browsers killing browser process +1m
  cypress:server:video:frames writing video frame +981ms
  cypress:server:video:frames video stream drained +0ms
  cypress:server:video:frames writing video frame +144ms
  cypress:server:video:frames video stream drained +0ms
  cypress:server:video capture stderr log { message: �[32m'frame= 1826 fps= 27 q=12.0 size=    7680kB time=00:01:12.08 bitrate= 872.8kbits/s dup=504 drop=0 speed=1.05x    ' } �[31m+1s
  cypress:server:video:frames writing video frame +100ms
  cypress:server:video:frames video stream drained +0ms
  cypress:server:video:frames writing video frame +149ms
  cypress:server:video:frames video stream drained +0ms
  cypress:server:video:frames writing video frame +150ms
  cypress:server:video:frames video stream drained +0ms
  cypress:server:video:frames writing video frame +100ms
  cypress:server:video:frames video stream drained +0ms
  cypress:server:video capture stderr log { message: 'frame= 1839 fps= 27 q=12.0 size=    7680kB time=00:01:12.60 bitrate= 866.6kbits/s dup=513 drop=0 speed=1.05x    ' } +483ms
  cypress:server:video:frames writing video frame +100ms
  cypress:server:video:frames video stream drained +1ms
  cypress:server:video:frames writing video frame +150ms
  cypress:server:video:frames video stream drained +0ms
  cypress:server:video:frames writing video frame +99ms

Desired behavior:

We should at the least have some sort of timeout so that the video recording doesn't hang forever.

Ideally we should fix this completely by ending the recording and compressing/uploading the video.

Steps to reproduce: (app code and test code)

That's a tough one! This was reported by another user, so I don't have a completely reproducible example.

Versions

Cypress 3.4.1
BuildKite CI
Linux Debian - 9.9
Electron 61.0.3163.100

@jennifer-shehane jennifer-shehane added type: bug stage: needs investigating Someone from Cypress needs to look at this topic: video 📹 CI General issues involving running in a CI provider labels Oct 22, 2019
@bahmutov bahmutov self-assigned this Oct 22, 2019
@flotwig
Copy link
Contributor

flotwig commented Oct 22, 2019

I wonder if switching Electron to record video via CDP would fix this issue: #4628 (not currently implemented for Electron)

@bahmutov
Copy link
Contributor

bahmutov commented Oct 22, 2019 via email

@jennifer-shehane
Copy link
Member Author

@flotwig Yeah, I hope so. I will followup with them to see if there's improvement once 3.5.0 is out. Unfortunately it's an issue that is not consistent, so we'll see.

@TheWanderingWalnut
Copy link

We've been seeing this as well, where Cypress will put out 15+ minute files after a 20s test or so, as it only seems to stop recording once the session is killed. I have tried reproducing it in various ways, even cross-platform, and for me it is only happening in our specific tests (not on the example project with a similar set of code).

I have only seen this behaviour myself on Mac OSX using Cypress v3.4.1 and 3.5.0, though it is incredibly intermittent and hard to track.

There was a bug post a little while back about pending network requests possibly causing it to hang, though I was unable to prove or disprove this theory in my testing, as it seems to fail whether or not there are pending network requests.

@jennifer-shehane
Copy link
Member Author

@flotwig This issue is still persisting using 3.5.0. Any guidance on what to try to keep this issue from happening would be appreciated.

@djaromir
Copy link

djaromir commented Nov 4, 2019

Same thing happens to me with cypress 3.6.0 and 3.4.1, Win10
When I set video to false, the test run never exits anyway, finishes with:
cypress:server:run attempting to close the browser +8s cypress:server:browsers killing browser process +8s
And hangs

there are no:
cypress:server:video:frames video stream drained +0ms cypress:server:video:frames writing video frame +99ms

@jennifer-shehane
Copy link
Member Author

Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI General issues involving running in a CI provider stage: needs investigating Someone from Cypress needs to look at this topic: video 📹 type: bug
Projects
None yet
Development

No branches or pull requests

5 participants