cypress: 5.5.0 regression of 'We failed to record the video' error in Firefox when running 2 spec files
Regression of this fix https://github.com/cypress-io/cypress/issues/6408
Current behavior
We are running Cypress via Docker in our Gitlab CI/CD and it seems that the video recording issue is back with 5.5.0, reported here https://github.com/cypress-io/cypress/issues/6408 for Cypress 4.x. The specific image we are using is cypress/included:5.5.0@sha256:1bade581de1f7ea02b8a000f4526ded862e020adfd5f5b95cf58eb884cb344d3
Note this only affects Firefox, not Chrome.
Warning: We failed processing this video.
This error will not alter the exit code.
TimeoutError: operation timed out
at afterTimeout (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19)
at Timeout.timeoutTimeout [as _onTimeout] (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
Warning: We failed to record the video.
This error will not alter the exit code.
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
at ChildProcess.<anonymous> (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
at ChildProcess.emit (events.js:310:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
at ChildProcess.<anonymous> (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
at ChildProcess.emit (events.js:310:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
at ChildProcess.<anonymous> (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
at ChildProcess.emit (events.js:310:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Desired behavior
- Firefox video-recording should work.
- Tests should run and pass, even if video-recording fails.
Test code to reproduce
Code from here, running on Cypress 5.5.0 replicates this: https://github.com/cypress-io/cypress/issues/6408
Versions
- Cypress 5.5.0
cypress/included:5.5.0@sha256:1bade581de1f7ea02b8a000f4526ded862e020adfd5f5b95cf58eb884cb344d3 - Gitlab 13.4.3-ee
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 11
- Comments: 47 (3 by maintainers)
Commits related to this issue
- temp video off for test — committed to wikimedia/wikipedia-kaios by hueitan 3 years ago
- Move TW+Cypress helpers into support module Otherwise we try running it as an integration test - which *seems* harmless, but appears to run afoul of a weird bug with video recording [1] [1] https://... — committed to hoelzro/tiddlywiki-first-class-urls by hoelzro 3 years ago
Have the same problem with Chrome 89.
Found a quick temp fix is to add the below to the cypress config:
"video": false@laerteneto, @rubencodes, @ViniciusResende - It’s an unfortunate state of affairs, but video in Cypress is just plain broken in FF93+. Pranajv1001 has created https://github.com/cypress-io/cypress/issues/18415, and I’ve started looking into the problem over there.
I’m going to suggest we move conversation to that issue, just so we have one bug for tracking the problem. Closing this issue does not reflect a belief that this isn’t a real issue, or a lack of interest in fixing it! It is both real and important. Just trying to consolidate the conversation into one place.
Started to happen with Chrome 89, was working fine with Chrome 88
So, this issue has become a bit of a catchall for ffmpeg errors in general, but there is at least one case that may have an explanation with a hint from https://github.com/cypress-io/cypress/issues/9128#issuecomment-795687329
Theory on some of these ffmpeg errors
Cypress trashes the video and screenshot folder by default before each run when run via
cypress run. If tests are run in parallel in Cypress, where there are multiple calls ofcypress runbeing run at the same time, the video folder will be deleted at the start of each call tocypress run. If another parallel run is trying to access the video folder after this directory has been deleted, this could cause the errors about " No such file or directory" or also possibly the compression errors like “compression errored”.We haven’t verified this completely but this seems like a scenario that could happen.
Suggestion
Set the Cypress config property
trashAssetsBeforeRunstofalse. This will not delete the video, screenshots, and download folders whenevercypress runis called.Please let us know if this resolved any of your issues and we can come up with a larger solution.
We are also seeing this problem pop up in our gitlab pipelines with 8.3.0.
Warning: We failed processing this video. This error will not alter the exit code. TimeoutError: operation timed out at afterTimeout (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19) at Timeout.timeoutTimeout [as _onTimeout] (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)We are using Electron 91 and only have videos set to save upon failure:
videoUploadOnPasses=false@jennifer-shehane This does not seem to fix the issue for me on Cypress 8.2.0 on GitHub actions with browser Firefox. The video processing still fails (and I am running them sequentially). The timeout would suggest that cypress gets killed before the video is finished processing.
UPDATE: What is interesting is that the videos are actually generated. I do store them as artifact and I can download them and although they seem to be missing some frames, they seem to be fine.
The full error text (after each test run) is:
@wrotson
Also having the above^ issue. Running Cypress
9.2.1in GitLab CI/CD, on Firefox, with thecypress/browsers:node16.5.0-chrome94-ff93image, I get the output:I ran with
DEBUG=cypress:server:video, and see the following output towards the start of my test run:(No additional
cypress:server:videooutput after that.)I have
videoset totrueandtrashAssetsBeforeRunsset tofalsein mycypress.jsonfile. I should note, I’m not running tests in parallel.Potentially unrelated, but I see the following output at the start of my run as well:
I’m facing ffmpeg error with Cypress version : 7.5.0 . Do we have a fix were we can have parallel support + video recording ?? I had to disable video.
Below are the debug logs from cypress
cypress:server:video capture errored: { error: 'ffmpeg exited with code 1: /tmp/build/123/codebase/cypress/videos/test.spec.js.mp4: No such file or directory\n', stdout: '', stderr: 'ffmpeg version N-47683-g0e8eb07980-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers\n' + ' built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516\n' + ' configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg\n' + ' libavutil 56. 24.101 / 56. 24.101\n' + ' libavcodec 58. 42.100 / 58. 42.100\n' + ' libavformat 58. 24.100 / 58. 24.100\n' + ' libavdevice 58. 6.101 / 58. 6.101\n' + ' libavfilter 7. 46.101 / 7. 46.101\n' + ' libswscale 5. 4.100 / 5. 4.100\n' + ' libswresample 3. 4.100 / 3. 4.100\n' + ' libpostproc 55. 4.100 / 55. 4.100\n' + '[mjpeg @ 0x678c140] EOI missing, emulating\n' + "Input #0, image2pipe, from 'pipe:0':\n" + ' Duration: N/A, start: 1624006383.640000, bitrate: N/A\n' + ' Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc\n' + '/tmp/build/123/codebase/cypress/videos/test.spec.js.mp4: No such file or directory\n' }this seems to have fixed it for me (still testing but 10 clean runs so far):
cypress.jsonfile looks like@jarretmoses adding
"video" : falseto your config file should fix it (not 100% sure since some people say it still happens with that). You’ll lose video recordings thoughThis might help someone. We used to face a similar issue with chrome and cypress 6.3.0. Then we came to know with the Cypress team’s support that this happens because we were running 3 parallel processes of
cypress runon the same server using Jenkins. Next, we tried running a single process on the same server and purposely failing some of the tests, in that case, it worked perfectly fine(videos were recorded properly). The root cause was either the parallelization not being handled properly or high usage of the server resources. Though we are sceptical it’s the latter because all the time while running 3 processes, server resources were underutilized. Now we are trying to dockerize thecypress run.