On cypress run, error "We failed to trash the existing run results"
See original GitHub issueCurrent behavior:
Running cypress run emits an error:
Warning: We failed to trash the existing run results.
This error will not alter the exit code.
Error: Command failed: /Users/jennifer/Library/Caches/Cypress/3.1.2/Cypress.app/Contents/Resources/app/packages/server/node_modules/trash/lib/macos-trash /Users/jennifer/Dev/cypress-example-kitchensink/cypress/screenshots/examples
“examples” couldn’t be moved to the trash.
at ChildProcess.exithandler (child_process.js:282:12)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:921:16)
at Socket.stream.socket.on (internal/child_process.js:348:11)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at Pipe._handle.close [as _onclose] (net.js:549:12)
Desired behavior:
Not error when trashing folders within videos folder.
Steps to reproduce:
All I did was cypress run on a previous run cypress-example-kitchensink project. Of course on subsequent runs of of cypress run do not produce the same error. 😞
Versions
Cypress 3.1.2 Mac High Sierra
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:26 (5 by maintainers)
Top Results From Across the Web
reactjs - Trash/delete screenshots before Cypress runs via npx ...
Cypress does not record videos or screenshots during cypress open , so there will be nothing to trash.
Read more >Screenshots and Videos - Cypress Documentation
Cypress clears any existing screenshots before cypress run . If you do not want to clear your screenshots folder before a run, you...
Read more >cypress-io/cypress - Gitter
@dwelle I run cypress run and then echo $? and it's always 0 ... what reporter should I use to get a minimal...
Read more >Testing Time Zones in Parallel - Gleb Bahmutov
Running the same Cypress tests with different browser time zones in ... Our test will just confirm the time zone text is present,...
Read more >Configurations in Cypress and How to Disable Default ...
Moreover, when we do Cypress open or do cypress run, Cypress open, or runs all the test present in the Integration folder. But...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It seems the problem only happens when a snapshot is open by an application somewhere else while cypress is trying to clean the directory, so it can’t. At least that’s seems how I fixed it, by closing the app that still viewing the snapshot images.
Hope it helps
Still exists in 10.9.0