You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've seen an intermittent error Error: Insufficient frames captured to create video in a few of our Cypress Cloud runs for very short tests (the test where this happens runs an API request in Cypress and verifies the results match a static array we have in our code, used for checking some particular values exist on a test environment):
[2025-02-07T09:25:41.939Z] 1 passing (502ms)
[2025-02-07T09:25:46.101Z] Warning: We failed capturing this video.
[2025-02-07T09:25:46.101Z]
[2025-02-07T09:25:46.101Z] This error will not affect or change the exit code.
[2025-02-07T09:25:46.101Z]
[2025-02-07T09:25:46.101Z] Error: Insufficient frames captured to create video.
[2025-02-07T09:25:46.101Z] at ChildProcess.<anonymous> (<embedded>:804:16306)
[2025-02-07T09:25:46.101Z] at ChildProcess.emit (node:events:518:28)
[2025-02-07T09:25:46.101Z] at ChildProcess._handle.onexit (node:internal/child_process:293:12)
[2025-02-07T09:25:46.101Z] An error was thrown in your plugins file while executing the handler for the after:spec event.
[2025-02-07T09:25:46.101Z]
[2025-02-07T09:25:46.101Z] The error we received was:
[2025-02-07T09:25:46.101Z]
[2025-02-07T09:25:46.101Z] Error: ENOENT: no such file or directory, unlink '/home/jenkins/workspace/our_repo@2/packages/e2e/videos/checkAllValuesExist.cy.ts.mp4'
[2025-02-07T09:25:46.101Z] at Module.unlinkSync (node:fs:1878:11)
[2025-02-07T09:25:46.101Z] at Object.handler (file:///home/jenkins/workspace/our_repo@2/packages/e2e/cypress.config.ts:47:28)
[2025-02-07T09:25:46.101Z] at invoke (/home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:185:18)
[2025-02-07T09:25:46.101Z] at /home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:59:14
[2025-02-07T09:25:46.101Z] at tryCatcher (/home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23)
[2025-02-07T09:25:46.101Z] at Promise.attempt.Promise.try (/home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29)
[2025-02-07T09:25:46.101Z] at Object.wrapChildPromise (/home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:58:23)
[2025-02-07T09:25:46.101Z] at RunPlugins.execute (/home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:164:21)
[2025-02-07T09:25:46.101Z] at EventEmitter.<anonymous> (/home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:56:12)
[2025-02-07T09:25:46.101Z] at EventEmitter.emit (node:events:518:28)
[2025-02-07T09:25:46.101Z] at process.<anonymous> (/home/jenkins/.cache/Cypress/14.0.2/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
[2025-02-07T09:25:46.101Z] at process.emit (node:events:518:28)
[2025-02-07T09:25:46.101Z] at emit (node:internal/child_process:951:14)
[2025-02-07T09:25:46.101Z] at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
[2025-02-07T09:25:46.101Z] error Command failed with exit code 1.
[2025-02-07T09:25:46.101Z] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[2025-02-07T09:25:46.101Z]
Our Cypress config:
e2e: {// eslint-disable-next-line prefer-arrow/prefer-arrow-functionssetupNodeEvents(on,_config){on('after:spec',(spec: Cypress.Spec,results: CypressCommandLine.RunResult)=>{if(results?.video){// Do we have failures for any retry attempts?constfailures=results.tests.some(test=>test.attempts.some(attempt=>attempt.state==='failed'));if(!failures){// delete the video if the spec passed and no tests retried// eslint-disable-next-line security/detect-non-literal-fs-filenamefs.unlinkSync(results.video);}}});on('task',{log: message=>{// eslint-disable-next-line no-consoleconsole.log(message);returnnull;},});},
I noticed #28643 fixed a similar issue, and it mentions this scenario specifically as a known scenario:
To handle the known scenario where ffmpeg did not receive enough frames, the error message has been updated to provide context to the Cypress issue.
What is the fix for this known issue, if any? Thank you!
Desired behavior
Give more guidance on how to resolve the issue / the root cause, if it is a known issue.
Test code to reproduce
See the description above
Cypress Version
14.0.2
Node version
20.18.1
Operating System
Jenkins
Debug Logs
Other
I raised this previously with Cypress Cloud Support the first time it happened (we have an enterprise licence at my company) but didn't get very far without providing debug logs - it's intermittent, and we don't want to run our tests with debug logs on all the time.
I'm hoping raising an issue here will make its way back to the engineering implementation team who might be able to give me some more info! Thanks!
The text was updated successfully, but these errors were encountered:
Worth putting the fs.unlink statement in a try/catch to see if that resolves the failures in our tests, so I will try that in the meantime. Something like:
on('after:spec',(_spec: Cypress.Spec,results: CypressCommandLine.RunResult)=>{if(results?.video){// Do we have failures for any retry attempts?constfailures=results.tests.some(test=>test.attempts.some(attempt=>attempt.state==='failed'));if(!failures){// delete the video if the spec passed and no tests retriedtry{// eslint-disable-next-line security/detect-non-literal-fs-filenamefs.unlinkSync(results.video);}catch(error){// Sometimes we get an error if the test is too short for ffmpeg in Cypress to create a video: https://github.com/cypress-io/cypress/issues/31046// eslint-disable-next-line no-consoleconsole.error('Error deleting video',error);}}}});
@ahayes91 Yah, I feel like it's some strange combination of low frames being captured with this logic to delete the video, it doesn't make sense just reading the code though.
Current behavior
Hi there!
We've seen an intermittent error
Error: Insufficient frames captured to create video
in a few of our Cypress Cloud runs for very short tests (the test where this happens runs an API request in Cypress and verifies the results match a static array we have in our code, used for checking some particular values exist on a test environment):Our Cypress config:
I noticed #28643 fixed a similar issue, and it mentions this scenario specifically as a known scenario:
What is the fix for this known issue, if any? Thank you!
Desired behavior
Give more guidance on how to resolve the issue / the root cause, if it is a known issue.
Test code to reproduce
See the description above
Cypress Version
14.0.2
Node version
20.18.1
Operating System
Jenkins
Debug Logs
Other
I raised this previously with Cypress Cloud Support the first time it happened (we have an enterprise licence at my company) but didn't get very far without providing debug logs - it's intermittent, and we don't want to run our tests with debug logs on all the time.
I'm hoping raising an issue here will make its way back to the engineering implementation team who might be able to give me some more info! Thanks!
The text was updated successfully, but these errors were encountered: