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

'Warning: We failed capturing this video' error when tests are very short duration (2 secs or less) or skipped #27898

Closed
ryanthemanuel opened this issue Sep 25, 2023 · 6 comments · Fixed by #28643

Comments

@ryanthemanuel
Copy link
Collaborator

Current behavior

When video is enabled and all tests on a spec are skipped, we get the following error in standard output:

Warning: We failed capturing this video.

This error will not affect or change the exit code.

TimeoutError: operation timed out
    at afterTimeout (/Users/ryanm/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/timers.js:46:19)
    at Timeout.timeoutTimeout [as _onTimeout] (/Users/ryanm/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/timers.js:76:13)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

Desired behavior

In 12, we actually captured a video with no real information in this scenario but it didn't fail.

Test code to reproduce

Any project really will work for this. Video needs to be enabled and a spec needs to have all tests skipped.

Cypress Version

13.2.0

Node version

v18.15.0

Operating System

macOS 13.4.1

Debug Logs

No response

Other

No response

@karthivijay
Copy link

Facing the same issue with cypress 12.5.1. The video recording works fine with chrome but not with Firefox

@PvtSec

This comment was marked as off-topic.

@jennifer-shehane
Copy link
Member

@karthivijay Please see the Firefox issue. This issue is only tracking the error on all browsers when all tests are skipped in a spec.

@pavel-blagodov
Copy link

pavel-blagodov commented Nov 8, 2023

I'm observing the same issue with electron and exactly same cypress version

@jennifer-shehane jennifer-shehane changed the title Error capturing video when all tests are skipped on a spec 'Warning: We failed capturing this video' error when tests are very short duration (2 secs or less) or skipped Dec 8, 2023
@jennifer-shehane
Copy link
Member

Just adding some insight here after some investigation. This can also be recreated by running a very short test as well as a spec where all tests are skipped (0 duration).

it("test", () => {
  expect(true).to.be.true
});

In this case, there are less frames being written to the video as shown below (only 1 frame written).

Screen Shot 2023-12-07 at 5 32 44 PM (1)

Compared to a run without this error shown (3 frames written)

Screen Shot 2023-12-07 at 5 40 37 PM (1)

When there are less than 2 frames written, these lines of code run: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/video_capture.ts#L135-L136 I would expect this would give a 3 sec timeout where more frames would be written then we can move on, but something isn't working at this point and causing the capture error.

This error is occuring more often in v13 with --record as opposed to on v12 or without --record because we made a change in v13 to automatically hide the Runner UI when recording to the Cloud (--no-runner-ui) in order to speed up test runs. This does indeed speed up the test run! And it makes the tests that were previously not seeing this error now see this error because they're running so quickly.

Unfortunately hitting this capture error seems to take time in itself, so we have seen an increase in runtime when this error state is hit, which could cause tests to run slower. I saw this as a few seconds testing locally, but had seen this on another user's run as taking more than 30 seconds.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 17, 2024

Released in 13.6.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.6.3, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: ready for work The issue is reproducible and in scope label Jan 17, 2024
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants