github-action: Job hangs after tests pass

I have a job that uses a custom command to run on multiple .cy files. The job fans out using the matrix strategy.

The timeout is set to 20 minutes. Some of the jobs finish, but a couple are mysteriously timing out even after the tests complete. This example has only 2 tests that finish long before 20 minutes:

image

Here is the cypress step:


      - name: Cypress run
        uses: cypress-io/github-action@v3
        with:
          browser: chrome
          install: false
          working-directory: services/webapp
          record: true
          group: ${{ matrix.file-path }}
          command:
            pnpx cypress run --spec ${{ matrix.file-path }} --record ${{ secrets.CYPRESS_RECORD_KEY
            }}
        env:
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TZ: UTC
        timeout-minutes: 20

I was previously running cypress directly and this issue only started after I switched to using cypress-io/github-action. I can’t determine what is unique about the files that time out. Any ideas would be much appreciated. πŸ™

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 40 (1 by maintainers)

Most upvoted comments

@MikeMcC399 I see the summary:

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ βœ”  buy-button.cy.ts                         00:13        1        1        -        -        - β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    βœ”  All specs passed!                        00:13        1        1        -        -        -  

Error: The action has timed out.

Feel free to close this issue when it seems resolved. It’s no longer relevant for me. thanks πŸ˜ƒ

Thank you so much for your contributions and aid in troubleshooting, @MikeMcC399 !

If you are experiencing this issue, please provide a reproducible example along with resource values for the job, so we can better investigate.

Thanks!

@ricardo-dematos

Please do transfer your other points (video and Node.js version) to new separate issues.

@ricardo-dematos

I just have a few comments - unfortunately I don’t have a solution!

Using electron I got the ERROR:gpu_memory_buffer_support_x11 on GitHub Ubuntu Β· Issue #25357 Β· cypress-io/cypress, so I removed it from the browser matrix and added the ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu' line.

As far as we know, this error message is just cosmetic.

In jobs that timeout, I don’t see the summary, but that’s most certainly due to setting a timeout of 10 min for the step.

If there is no summary, then I would assume that Cypress (invoked through Cypress: Module API) has not returned control to github-action, so the problem would be in Cypress - possibly a resource constraint, however that is just a theory.

When not defining the browser setting, the action uses electron and in the log one can read:

  (Video)

  -  Started compressing: Compressing to 32 CRF                                                     
write EPIPE
Error: write EPIPE

Video compression is resource intensive. It is planned to make video: false the default in the upcoming Cypress 13 version. You may like to disable it now. (It’s already like that in https://github.com/cypress-io/github-action/blob/master/examples/browser/cypress.config.js in the browser examples here.)

  • I see the Warning: We failed capturing this video. error, when defining it to firefox;

This is a known issue with Firefox run from Cypress, see https://github.com/cypress-io/cypress/issues/18415

Before the cypress-io/github-action@v5 step, I’m setting up the Node to v18 and installing our dependencies.

In the log I noticed that the reported Node Version is v16:

github-action runs as a JavaScript GitHub Action and the version is defined separately through https://github.com/cypress-io/github-action/blob/d69252d52b9a31bad4f418f05ba2bc83687a02eb/action.yml#L99-L101

The app runs under v18 in your case and Cypress runs under v16, which is a bit strange, but it is the way it works.

Are any of the contributors here able to post a reproducible example of the action timing out? That would be helpful to get closer to identifying the root cause.

All of the examples workflows in .github/workflows of this repository complete without a problem, although none of them are resource intensive (assuming that is a contributing factor to the timeout).

The main.yml workflow from the cypress-io/cypress-realworld-app. which is more complex, also passes without timing out.

So the standard examples can’t be used for troubleshooting this issue.

I don’t know how to troubleshoot this further if there are no error messages (apart from the timeout). Hopefully the Cypress.io team will have some ideas.

@MikeMcC399 that sounds correct

Yeah, might be more likely then… It runs all perfectly locally but in CI it’s been not so good.

I’ll try that and see what I can find out. Thank you!