github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Github action worker hangs when tests in parallel have finished

Open alessioerosferri opened this issue 3 years ago • 15 comments

Current behaviour: My GitHub workflow runs in parallel using multiple containers connected to Cypress dashboard and, when the run shows as finished on Cypress dashboard, I can still see a few containers that are hanging forever. Nothing is being logged from these containers. As soon as I cancel the workflow, the final GitHub log shows that the pod had finished correctly but Github did not receive an exit 0 command from the cypress process.

Expected behaviour: I would like the workers to finish correctly when the run finishes and all tests have run.

Cypress version: 9.3.1

alessioerosferri avatar Feb 17 '22 21:02 alessioerosferri

image

alessioerosferri avatar Feb 18 '22 10:02 alessioerosferri

It stays there at recorded run forever, I have to manually close the worker

alessioerosferri avatar Feb 18 '22 10:02 alessioerosferri

Up to now, it seems that this hanging problem happens only when the cypress.json file has key video set to false

alessioerosferri avatar Feb 18 '22 11:02 alessioerosferri

When logs are in debug mode, it seems the problem that makes it hang is this one:

browsers.kill called with no active instance

alessioerosferri avatar Feb 18 '22 16:02 alessioerosferri

not running anything in parallel but as soon as I set video to false in config the whole action can't proceed to finish and hangs with error CypressError: cy.screenshot() timed out waiting 30000ms to complete.:

name: E2E Tests
on: [push]
jobs:
  cypress-run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          build: yarn run build
          start: npm run start
          wait-on: http://localhost:3000
        env:
          DATABASE_URL: ${{secrets.DATABASE_URL}}
          NEXTAUTH_SECRET: ${{secrets.NEXTAUTH_SECRET}}

      - uses: actions/upload-artifact@v2
        if: always()
        with:
          name: Cypress E2E Videos
          path: cypress/videos

d-ivashchuk avatar Feb 20 '22 08:02 d-ivashchuk

Ah alright, my issue is different, I managed to solve it when using chrome as a browser for the tests

On Sun, 20 Feb 2022 at 08:37, Dimitri Ivashchuk @.***> wrote:

not running anything in parallel but as soon as I set video to false in config the whole action can't proceed to finish and hangs with error CypressError: cy.screenshot() timed out waiting 30000ms to complete.:

name: E2E Tests on: [push] jobs: cypress-run: runs-on: ubuntu-latest steps: - name: Checkout uses: @.***

  - name: Cypress run
    uses: ***@***.***
    with:
      build: yarn run build
      start: npm run start
      wait-on: http://localhost:3000
    env:
      DATABASE_URL: ${{secrets.DATABASE_URL}}
      NEXTAUTH_SECRET: ${{secrets.NEXTAUTH_SECRET}}

  - uses: ***@***.***
    if: always()
    with:
      name: Cypress E2E Videos
      path: cypress/videos

— Reply to this email directly, view it on GitHub https://github.com/cypress-io/github-action/issues/507#issuecomment-1046189350, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG4F36LW63YVT462NDNJLXDU4CR47ANCNFSM5OV4HHTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

alessioerosferri avatar Feb 20 '22 10:02 alessioerosferri

@d-ivashchuk I've the same error. With video: false it shows CypressError: cy.screenshot() timed out waiting 30000ms to complete.

I've set "screenshotOnRunFailure": false and now at least my job finishes.

Did you managed to find a proper solution? Thanks.

jaapaurelio avatar Mar 13 '22 10:03 jaapaurelio

I have similar hanging problem.

kmsheng avatar May 18 '22 02:05 kmsheng

I'm also facing a similar problem. When i run tests in parallel in github actions one of the machines hung up and when cancelled manually I could see tests were completed. Any solution for this issue?

jaganrocketlane avatar Aug 04 '22 18:08 jaganrocketlane

Same issue here, several machines are hanging when running the tests in parallel, it started just a few days ago, nothing changed from our side so not sure what can be causing the issues.

rbknajera avatar Aug 12 '22 19:08 rbknajera

@rbknajera were you able to overcome this issue?

jaganrocketlane avatar Aug 22 '22 11:08 jaganrocketlane

@jaganrocketlane Yes! Everything is running smoothly again, I've not seen any more issues

rbknajera avatar Aug 22 '22 15:08 rbknajera

@rbknajera could you please let me know your cypress version? I'm still facing this issue. 5 machines are hanging everytime

jaganrocketlane avatar Aug 23 '22 11:08 jaganrocketlane

@jaganrocketlane Actually, I started seeing the issue again, random machines are hanging with no reason on every run. I updated to Cypress v10.5.0 last week.

rbknajera avatar Aug 24 '22 15:08 rbknajera

@jaganrocketlane Actually, I started seeing the issue again, random machines are hanging with no reason on every run. I updated to Cypress v10.5.0 last week.

I'm experiencing the same issue

PJEstrada avatar Sep 07 '22 20:09 PJEstrada

Changing from cypress-io/github-action@v2 to cypress-io/github-action@v5 resolved the issue to me.

duckdum avatar Jan 18 '23 14:01 duckdum

@duckdum

Changing from cypress-io/github-action@v2 to cypress-io/github-action@v5 resolved the issue to me.

cypress-io/github-action@v5 uses node16, whereas cypress-io/github-action@v2 uses node12. That may however not be the real reason for @v5 working for you.

The runs from the parallel example-recording.yml are all successful (see https://github.com/cypress-io/github-action/actions/workflows/example-recording.yml?query=branch%3Amaster), although this can't be considered a stress test. They currently use the GitHub runner ubuntu-22.04 with Cypress 9.7.0 and 12.3.0.

I wonder if other users are still seeing the issue?

MikeMcC399 avatar Jan 18 '23 15:01 MikeMcC399

This seems to be a stale issue regarding older versions as there have been no new reports of the problem during the last months.

MikeMcC399 avatar Nov 12 '23 23:11 MikeMcC399