cypress: `cypress ci` does not issue proper exit code in Codeship CI
I am having an issue when running tests in Codeship. The tests should exit with the number of failures, but instead it times out.
Error Message
--------------------------------------------------------------------------------
This command didn't output anything for 10 minutes, thus we stopped it.
Please make sure your steps regularly print to standard out or standard error.
If the error is on our end please inform us so we can help you to fix this.
--------------------------------------------------------------------------------
Screenshot

Codeship’s support team input
I took a look at some of your builds and I’m wondering more about the
cypress cicommand. It looks like it finishes, but maybe isn’t giving an exit code? Codeship relies on scripts/commands providing a meaningful exit code to know when the command is done and also to then know to move on to the next command or if the build should be failed.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 37 (21 by maintainers)
Commits related to this issue
- cy.exec should run child process in detached mode, close #328 — committed to cypress-io/cypress by bahmutov 6 years ago
Also just wanted to say you are awesome @joesiewert as I don’t think we would have ever been able to figure this out, haha.
I was bit by this yesterday, and came up with a workaround script. It’s not a long-term solution, but I’m posting here because it could be useful to someone: https://gist.github.com/bgschiller/397ad1ca123aa15f331f3f3ec9717e5f
The workaround is:
I’m still seeing this hang on Codeship Basic without this workaround in place.
Finally managed to track this down. It looks like
~/.bash_profileis getting sourced whency.execis called.Taking a look at
~/.bash_profileon Codeship,eval $(ssh-agent)is getting called and is responsible for causing Cypress to hang.There are probably a number of ways to workaround this, but I think the simplest thing is to just drop these commands from
~/.bash_profilebefore running Cypress:Suggested doc updates here: https://github.com/cypress-io/cypress-documentation/pull/759
yeah, seems even a single unit test that uses
cy.execon Codeship basic, even something simple like the echo below is hanging.