Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job hangs after tests pass #620

Closed
gigamesh opened this issue Nov 2, 2022 · 40 comments
Closed

Job hangs after tests pass #620

gigamesh opened this issue Nov 2, 2022 · 40 comments
Labels
Needs Reproduction We are currently lacking steps to reproduce this scenario reliably

Comments

@gigamesh
Copy link

gigamesh commented Nov 2, 2022

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. 🙏

@jonasberglund
Copy link

Did you find any solution to this issue? I'm having the same problem currently...

@MikeMcC399
Copy link
Collaborator

@jonasberglund

Did you find any solution to this issue? I'm having the same problem currently...

Can you share your full *.yml workflow together with the version of Cypress you are using?

@jonasberglund
Copy link

@MikeMcC399 sure! I've tested multiple cypress versions (12.7.0 - 12.15.0) since I suspected that might be the issue but none of them are working correctly.

Currently I'm running on the latest version 12.15.0

name: E2E Tests

on:
  push:
  workflow_dispatch:

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  cypress:
    name: Cypress
    runs-on: ubuntu-20.04
    timeout-minutes: 20
    steps:
      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: 20.x

      - name: Increase Node Memory Limit
        id: Increase-memory
        run: |
          echo "NODE_OPTIONS=--max-old-space-size=8192" >> $GITHUB_ENV

      - name: Checkout
        uses: actions/checkout@v3

      - name: Cypress run
        uses: cypress-io/github-action@v5
        env:
          DEBUG: '@cypress/github-action'
        with:
          start: npm start
          wait-on: 'http://localhost:3000'
          wait-on-timeout: 120

@MikeMcC399
Copy link
Collaborator

@jonasberglund

Your workflow looks perfect 👍🏻 !

You already have timeout-minutes: 20 (to protect against a job hanging) and DEBUG: '@cypress/github-action' (to get more information) defined.

Would you then also post the output from the action log if possible? Or you could compare it to a successful run https://github.com/cypress-io/github-action/actions/runs/5279381053 here with debug enabled.

@jonasberglund
Copy link

jonasberglund commented Jun 21, 2023

Thanks @MikeMcC399

I can't share the full thing but here is a cut out

Received 122203124 of 122203124 (100.0%), 81.1 MBs/sec
Cache Size: ~117 MB (122203124 B)
/usr/bin/tar -xf /home/runner/work/_temp/d084e50d-c289-42ef-bfa6-e2c34b28a48c/cache.tzst -P -C /home/runner/work/.../... --use-compress-program unzstd
Received 159074704 of 159074704 (100.0%), 95.6 MBs/sec
Cache Size: ~152 MB (159074704 B)
/usr/bin/tar -xf /home/runner/work/_temp/a0dd93e6-e967-4927-9673-af48a6dfcce4/cache.tzst -P -C /home/runner/work/.../... --use-compress-program unzstd
Cache restored successfully
Cache restored successfully
2023-06-21T08:24:41.356Z @cypress/github-action npm cache hit npm-linux-x64-014939e97ce04a0ab9ced1f9af44a73e760ead60e57afe675d2562400923ce64bb5e009f30ddd18a1d82e841c4b13f7594e901399a66438d387e090036295ce7
2023-06-21T08:24:41.356Z @cypress/github-action cypress cache hit cypress-linux-x64-014939e97ce04a0ab9ced1f9af44a73e760ead60e57afe675d2562400923ce64bb5e009f30ddd18a1d82e841c4b13f7594e901399a66438d387e090036295ce7
2023-06-21T08:24:41.357Z @cypress/github-action installing npm dependencies
2023-06-21T08:24:41.358Z @cypress/github-action npm at "/opt/hostedtoolcache/node/20.3.0/x64/bin/npm"
/opt/hostedtoolcache/node/20.3.0/x64/bin/npm ci

added 2769 packages in 31s

444 packages are looking for funding
  run `npm fund` for details
2023-06-21T08:25:12.977Z @cypress/github-action install has finished
2023-06-21T08:25:12.977Z @cypress/github-action Cypress versions in the cache folder /home/runner/.cache/Cypress
/opt/hostedtoolcache/node/20.3.0/x64/bin/npx cypress cache list
┌─────────┬───────────────────┐
│ version │ last used         │
├─────────┼───────────────────┤
│ 12.15.0 │ a few seconds ago │
└─────────┴───────────────────┘
2023-06-21T08:25:13.700Z @cypress/github-action no need to verify Cypress binary or save caches
2023-06-21T08:25:13.700Z @cypress/github-action Separated 1 start commands npm start
start server command "npm start"
current working directory "/home/runner/work/.../..."
2023-06-21T08:25:13.701Z @cypress/github-action parsed command: npm start
2023-06-21T08:25:13.701Z @cypress/github-action Waiting for urls http://localhost:3000
waiting on "http://localhost:3000" with timeout of 120 seconds
2023-06-21T08:25:13.701Z @cypress/github-action Waiting for url http://localhost:3000
2023-06-21T08:25:13.702Z @cypress/github-action total ping timeout 150000
2023-06-21T08:25:13.702Z @cypress/github-action individual ping timeout 30000ms
2023-06-21T08:25:13.702Z @cypress/github-action retries limit 5
2023-06-21T08:25:13.715Z @cypress/github-action got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1687335913707,"socket":1687335913708,"lookup":1687335913708,"error":1687335913709,"phases":{"wait":1,"dns":0,"total":2}}}
2023-06-21T08:25:13.715Z @cypress/github-action 13ms undefined undefined ECONNREFUSED attempt 1
2023-06-21T08:25:13.717Z @cypress/github-action found command "/opt/hostedtoolcache/node/20.3.0/x64/bin/npm"
2023-06-21T08:25:13.717Z @cypress/github-action with arguments start
2023-06-21T08:25:13.717Z @cypress/github-action running "/opt/hostedtoolcache/node/20.3.0/x64/bin/npm" start in /home/runner/work/.../...
2023-06-21T08:25:13.717Z @cypress/github-action waiting for the command to finish? false
/opt/hostedtoolcache/node/20.3.0/x64/bin/npm start

> react-app-rewired start

2023-06-21T08:25:14.719Z @cypress/github-action got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1687335914718,"socket":1687335914718,"lookup":1687335914718,"error":1687335914718,"phases":{"wait":0,"dns":0,"total":0}}}
2023-06-21T08:25:14.719Z @cypress/github-action 1017ms undefined undefined ECONNREFUSED attempt 2
2023-06-21T08:25:15.721Z @cypress/github-action got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1687335915720,"socket":1687335915721,"lookup":1687335915721,"error":1687335915721,"phases":{"wait":1,"dns":0,"total":1}}}
2023-06-21T08:25:15.721Z @cypress/github-action 2019ms undefined undefined ECONNREFUSED attempt 3
...
(node:1925) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:1925) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...

2023-06-21T08:25:46.726Z @cypress/github-action got error {"name":"TimeoutError","code":"ETIMEDOUT","timings":{"start":1687335916722,"socket":1687335916723,"lookup":1687335916723,"connect":1687335916723,"upload":1687335916723,"error":1687335946726,"phases":{"wait":1,"dns":0,"tcp":0,"request":0,"total":30004}},"event":"request"}
2023-06-21T08:25:46.726Z @cypress/github-action 33024ms undefined undefined ETIMEDOUT attempt 4
Compiled successfully!

You can now view ... in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://10.1.0.15:3000

Note that the development build is not optimized.
To create a production build, use npm run build.

webpack compiled successfully
No issues found.
2023-06-21T08:26:39.898Z @cypress/github-action pinging http://localhost:3000 has finished ok after 86196ms
2023-06-21T08:26:40.362Z @cypress/github-action Running Cypress tests using Module API
2023-06-21T08:26:40.362Z @cypress/github-action requiring cypress dependency, cwd is /home/runner/work/.../...
2023-06-21T08:26:40.363Z @cypress/github-action working directory /home/runner/work/.../...
2023-06-21T08:26:40.363Z @cypress/github-action resolved cypress /home/runner/work/.../.../node_modules/cypress/index.js
2023-06-21T08:26:40.363Z @cypress/github-action Cypress options {"headed":false,"record":false,"parallel":false,"quiet":false,"component":false}
[2034:0621/082641.119124:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.

DevTools listening on ws://127.0.0.1:33237/devtools/browser/8a2854a7-f247-48ec-adf5-a1596d6c13dc
[2190:0621/082642.162064:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.15.0                                                                        │
  │ Browser:        Electron 106 (headless)                                                        │
  │ Node Version:   v16.16.0 (/home/runner/runners/2.305.0/externals/node16/bin/node)              │
  │ Specs:          3 found (...)                                                                  │
  │ Searched:       cypress/e2e/*.cy.ts                                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  ...............cy.ts                                                           (1 of 3)


  Verify ...
    ✓ Verify ... (11120ms)
    ✓ Verify .... (5396ms)


  2 passing (17s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        2                                                                                │
  │ Passing:      2                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     16 seconds                                                                       │
  │ Spec Ran:     ................cy.ts                                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  ...........cy.ts                                                          (2 of 3)


  Verify ....
[2190:0621/082723.477231:ERROR:gl_utils.cc(319)] [.WebGL-0x249c00341c00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[2190:0621/082724.013109:ERROR:gl_utils.cc(319)] [.WebGL-0x249c00341c00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[2190:0621/082724.706237:ERROR:gl_utils.cc(319)] [.WebGL-0x249c00341c00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[2190:0621/082725.035409:ERROR:gl_utils.cc(319)] [.WebGL-0x249c00341c00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)
[2034:0621/082740.240569:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2034:0621/082740.241499:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2034:0621/082740.242235:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
    ✓ Verify the content .... (89714ms)
[2034:0621/082851.876790:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2034:0621/082851.877838:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2034:0621/082851.878761:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
    ✓ Verify the button .... (10083ms)


  2 passing (2m)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        2                                                                                │
  │ Passing:      2                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     1 minute, 39 seconds                                                             │
  │ Spec Ran:     .................cy.ts                                                           │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  ....cy.ts                                                          (3 of 3)

  Verify ...
    ✓ Verify the ... (30155ms)
[2034:0621/083016.341456:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2034:0621/083016.342171:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2034:0621/083016.342589:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
Error: The operation was canceled.

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Jun 21, 2023

@jonasberglund

It looks like you have 3 test specs. The first two pass and complete. The third (last) one starts and then hangs.

This doesn't look like it's an issue caused by github-action.

For further troubleshooting, you could run each of your test specs individually, and see if the third one also hangs up when run on its own.

You could also enable Cypress debug logs in addition:

  env:
    DEBUG: '@cypress/github-action, cypress:*'

I expect that it would need a reproducible example posting online if you want to ask for the Cypress team to get involved in troubleshooting.

It may be that you are hitting hardware limits for the standard GitHub-hosted runners.

Cypress has some recommendations for hardware dimensioning.

See GitHub Supported runners and hardware resources. GitHub offers in addition Larger runners.

@jonasberglund
Copy link

@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!

@gigamesh
Copy link
Author

Feel free to close this issue when it seems resolved. It's no longer relevant for me. thanks :)

@MikeMcC399
Copy link
Collaborator

@jonasberglund

Coincidentally there was an announcement today
https://github.blog/changelog/2023-06-21-github-hosted-larger-runners-for-actions-are-generally-available/

@TellVanDenBerghMM
Copy link

@jonasberglund

Did you manage to solve this issue?
I have the same problem.

image

@MikeMcC399
Copy link
Collaborator

@TellVanDenBerghMM

  • Did you enable debug logs?
  env:
    DEBUG: '@cypress/github-action, cypress:*'
  • Which version of Cypress are you using?
  • Which version of github-action are you using?

@TellVanDenBerghMM
Copy link

@MikeMcC399

Im using Cypress version 12.16.0
and Github action v5

I added the DEBUG and while it's stuck it logs this every 10 seconds.

image

@MikeMcC399
Copy link
Collaborator

@TellVanDenBerghMM
You can compare it to
https://github.com/cypress-io/github-action/actions/runs/5279381053/jobs/9549976962
which shows how github-action normally finishes up.

Do you have video enabled? If yes, then you could try disabling it.

@MikeMcC399
Copy link
Collaborator

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.

@TellVanDenBerghMM
Copy link

Okay, I will try.
Thank you.

@jonasberglund
Copy link

@TellVanDenBerghMM I still have the same issue and it sounds very similar to yours. I also get that they are stuck and it's not consistent, but it seem to be whenever maxMemRssMb reaches around 2000...

@juliette-derancourt
Copy link

I'm facing the same issue with:

  • Cypress v12.15.0
  • Cypress GitHub action v5.6.1
  • Video disabled

It runs all tests successfully, and then stop before printing the test summary (similar to the screenshot in #620 (comment))

@MikeMcC399
Copy link
Collaborator

@juliette-derancourt

It's possible that the reason for the hang may be resource limitations. For troubleshooting you may like to run only a subset of tests and see if they run to completion. If that is the case, then the previous comments in #620 (comment) may also be applicable to your situation.

@ricardo-dematos
Copy link

I'm facing the same issue with:

  • Cypress v12.16.0
  • Cypress GitHub action v5 ( v5.8.3, has of writing )

After some tries to overcome this, it seems that setting option browser causes this stall.

      - name: 'Run end-to-end tests'
        id: cypress
        uses: cypress-io/github-action@v5
        env:
          DEBUG: '@cypress/github-action'
        with:
          working-directory: 'e2e-tests'
          browser: 'chrome'
        timeout-minutes: 10

@MikeMcC399
Copy link
Collaborator

@ricardo-dematos

If you find that using browser: 'chrome' adversely affects how your tests run, then you might like to try

Experiments:

experimentalMemoryManagement
"Enables support for improved memory management within Chromium-based browsers."

@jodelamo
Copy link

jodelamo commented Jul 5, 2023

Happens here as well. In my case the job times out (after passing!) when adding firefox to the browser matrix.

Times out:

  e2e-tests:
    name: E2E Tests
    runs-on: ubuntu-latest
    strategy:
      matrix:
        browser: [chrome, edge, firefox]
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Run Cypress
        uses: cypress-io/github-action@v5
        with:
          browser: ${{ matrix.browser }}
          start: npm test

Works:

  e2e-tests:
    name: E2E Tests
    runs-on: ubuntu-latest
    strategy:
      matrix:
        browser: [chrome, edge]
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Run Cypress
        uses: cypress-io/github-action@v5
        with:
          browser: ${{ matrix.browser }}
          start: npm test

@MikeMcC399
Copy link
Collaborator

@jodelamo

Do you see the (Run Finished) summary displayed (example below) or does it time out before this?

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  spec.cy.js                               00:02        1        1        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:02        1        1        -        

@jodelamo
Copy link

jodelamo commented Jul 5, 2023

@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.

@MikeMcC399
Copy link
Collaborator

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.

@nagash77 nagash77 self-assigned this Jul 5, 2023
@nagash77 nagash77 added the Needs Reproduction We are currently lacking steps to reproduce this scenario reliably label Jul 5, 2023
@ricardo-dematos
Copy link

ricardo-dematos commented Jul 5, 2023

Thanks for the quick reply @MikeMcC399 ! 👍


As you suggested, I added experimentalMemoryManagement to cypress.config.ts.

I also tried with all browsers that ubuntu-latest provides.

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.

Despite this, the step execution sometimes hangs for chrome-based browsers in a non-deterministic way.


After enabling DEBUG, I see in the log the same pattern that @TellVanDenBerghMM mentions.


Curiously, contrary to @jonasberglund , in my workflow defining the browser setting to firefox always finishes with success.

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.

image


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
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writevGeneric (node:internal/stream_base_commons:143:3)
    at Socket._writeGeneric (node:net:815:11)
    at Socket._writev (node:net:824:8)
    at doWrite (node:internal/streams/writable:406:12)
    at clearBuffer (node:internal/streams/writable:561:5)
    at Writable.uncork (node:internal/streams/writable:348:7)
    at p.sendFrame (<embedded>:2404:495920)
    at p.dispatch (<embedded>:2404:495107)
    at p.send (<embedded>:2404:494940)
    at A.send (<embedded>:2404:505537)
    at _._enqueueCommand (<embedded>:2404:525846)
    at <embedded>:2404:523361
    at new Promise (<anonymous>)
    at _.send (<embedded>:2404:523335)
    at k.send [as sendDebuggerCommandFn] (<embedded>:4557:77430)
    at _.<anonymous> (<embedded>:4557:50879)
    at _.emit (node:events:527:28)
    at _._handleMessage (<embedded>:2404:525699)
    at A.<anonymous> (<embedded>:2404:525307)
    at A.emit (node:events:527:28)
    at g.U (<embedded>:2404:510587)
    at g.emit (node:events:527:28)
    at g.dataMessage (<embedded>:2404:490962)
    at <embedded>:2404:490494
    at <embedded>:2404:481816
    at <embedded>:2404:482768
    at afterWrite (node:internal/streams/writable:497:5)
    at onwrite (node:internal/streams/writable:477:7)
    at Zlib.cb (node:internal/streams/transform:202:7)
    at Zlib.processCallback (node:zlib:611:8)
Test run failed, code 1
More information might be available above
Cypress module has returned the following error message:
Could not find Cypress test run results
Error: Could not find Cypress test run results

If I remove the matrix strategy and just define the browser setting:

  • I don't see the write EPIPE error, when defining it to electron;
  • I see the Warning: We failed capturing this video. error, when defining it to firefox;
  • The step sometimes times-out, when defining it to chrome / chromium / edge;

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:

Cache restored successfully
/opt/hostedtoolcache/node/18.16.1/x64/bin/npm ci

added 192 packages, and audited 193 packages in 3s

47 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
/opt/hostedtoolcache/node/18.16.1/x64/bin/npx cypress cache list
┌─────────┬───────────────────┐
│ version │ last used         │
├─────────┼───────────────────┤
│ 12.16.0 │ a few seconds ago │
└─────────┴───────────────────┘

DevTools listening on ws://127.0.0.1:41219/devtools/browser/53789577-c80b-4b36-9339-d62846772d7d

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.16.0                                                                        │
  │ Browser:        Firefox 114 (headless)                                                         │
  │ Node Version:   v16.16.0 (/home/runner/runners/2.305.0/externals/node16/bin/node)              │
  │ Specs:          3 found (login-message.cy.ts, login.cy.ts, reset-password.cy.ts)               │
  │ Searched:       **/*.cy.ts                                                                     │
  │ Experiments:    experimentalMemoryManagement=true                                              │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

@ricardo-dematos
Copy link

This is my workflow, without the matrix strategy:

name: 'End-to-End Tests'

on:

  workflow_dispatch:
    inputs:
      deployment-url:
        description: 'Deployment URL where to execute this workflow'
        required: true
        default: ''
        type: string
      deployment-username:
        description: 'Deployment authentication (username)'
        required: true
        default: ''
        type: string
      deployment-password:
        description: 'Deployment authentication (password)'
        required: true
        default: ''
        type: string
      browser:
        description: 'Name of the browser to use'
        required: true
        default: 'chrome'
        type: choice
        options:
          - 'chrome'
          - 'chromium'
          - 'edge'
          - 'electron'
          - 'firefox'

jobs:

  # Execute End-to-End Tests
  e2e_tests:

    runs-on: ubuntu-latest

    # Set GITHUB_TOKEN required permissions
    permissions:
      contents: read
      actions: read

    steps:

      - name: 'Set up steps'
        id: setup
        run: |
          echo "::add-mask::$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-url"?' | sed --regexp-extended --expression 's/\/$//g' )"
          echo "::add-mask::$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-username"?' )"
          echo "::add-mask::$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-password"?' )"
          echo "repository=$( echo "${{ github.repository }}" )" >> $GITHUB_OUTPUT
          echo "repository_owner=$( echo "${{ github.repository_owner }}" )" >> $GITHUB_OUTPUT
          echo "repository_name=$( echo "${{ github.event.repository.name }}" )" >> $GITHUB_OUTPUT
          echo "branch_name=$( echo "${{ github.ref_name }}" )" >> $GITHUB_OUTPUT
          echo "branch_ref=$( echo "${{ github.ref }}" )" >> $GITHUB_OUTPUT
          echo "deployment_url=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-url"?' | sed --regexp-extended --expression 's/\/$//g' )" >> $GITHUB_OUTPUT
          echo "deployment_username=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-username"?' )" >> $GITHUB_OUTPUT
          echo "deployment_password=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-password"?' )" >> $GITHUB_OUTPUT
          echo "browser=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."browser"?' )" >> $GITHUB_OUTPUT
        shell: bash

      - name: 'Check out repository'
        id: checkout
        if: ${{ (steps.setup.outcome == 'success') }}
        uses: actions/checkout@v3
        with:
          ref: '${{ steps.setup.outputs.branch_ref }}'

      - name: 'Set up node'
        id: node
        if: ${{ (steps.checkout.outcome == 'success') }}
        uses: valispace/actions/setup-node@master
        with:
          node-version: 18
          node-dependencies-file: 'e2e-tests/package-lock.json'
          node-install-dependencies: true

      - name: 'Run end-to-end tests'
        id: cypress
        if: ${{ (steps.node.outcome == 'success') }}
        timeout-minutes: 10
        uses: cypress-io/github-action@v5
        env:
          ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu'  # see https://github.com/cypress-io/cypress/issues/25357
        with:
          working-directory: 'e2e-tests'
          env: 'host=${{ steps.setup.outputs.deployment_url }},username=${{ steps.setup.outputs.deployment_username }},password=${{ steps.setup.outputs.deployment_password }}'
          browser: '${{ steps.setup.outputs.browser }}'

      - name: 'Upload end-to-end tests screenshots'
        id: cypress-screenshots
        if: ${{ (success() || failure()) && (steps.cypress.outcome == 'failure') }}
        uses: actions/upload-artifact@v3
        with:
          name: 'cypress-screenshots-${{ steps.setup.outputs.browser }}'
          path: 'e2e-tests/cypress/screenshots'
          if-no-files-found: ignore

      - name: 'Upload end-to-end tests videos'
        id: cypress-videos
        if: ${{ (success() || failure()) && (steps.cypress.outcome == 'failure') }}
        uses: actions/upload-artifact@v3
        with:
          name: 'cypress-videos-${{ steps.setup.outputs.browser }}'
          path: 'e2e-tests/cypress/videos'
          if-no-files-found: ignore

@MikeMcC399
Copy link
Collaborator

@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 cypress-io/cypress#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

github-action/action.yml

Lines 99 to 101 in d69252d

runs:
using: 'node16'
main: 'dist/index.js'

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.

@nagash77 nagash77 removed their assignment Jul 7, 2023
@maciejmrozinski
Copy link

Which version of Chrome are you guys using? I have similar issue (even when running one cypress instance) when using one of the newest Chrome (with new headless mode): cypress-io/cypress#27264. Maybe this is somehow the same issue.

@ricardo-dematos
Copy link

Which version of Chrome are you guys using? I have similar issue (even when running one cypress instance) when using one of the newest Chrome (with new headless mode): cypress-io/cypress#27264. Maybe this is somehow the same issue.

In my case, it's the one that ubuntu-latest provides, which at the moment is 114.0.5735.198.

@ricardo-dematos
Copy link

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.)

Will you provide a setting to configure that option in the action?

@ricardo-dematos
Copy link

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

github-action/action.yml

Lines 99 to 101 in d69252d

runs:
using: 'node16'
main: 'dist/index.js'

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.

We are using badeball/[email protected], which requires Node v18 because it uses findLastIndex().

     CypressError: `cy.task('cypress-cucumber-preprocessor:spec-envelopes')` failed with the following error:

> state.messages.findLastIndex is not a function

https://on.cypress.io/api/task

Because this error occurred during a `before all` hook we are skipping the remaining tests in the current suite: `Specifications`
      at <unknown> (***/__cypress/runner/cypress_runner.js:151199:78)
      at tryCatcher (***/__cypress/runner/cypress_runner.js:18744:23)
      at Promise._settlePromiseFromHandler (***/__cypress/runner/cypress_runner.js:16679:31)
      at Promise._settlePromise (***/__cypress/runner/cypress_runner.js:16736:18)
      at Promise._settlePromise0 (***/__cypress/runner/cypress_runner.js:16781:10)
      at Promise._settlePromises (***/__cypress/runner/cypress_runner.js:16857:18)
      at _drainQueueStep (***/__cypress/runner/cypress_runner.js:13451:12)
      at _drainQueue (***/__cypress/runner/cypress_runner.js:13444:9)
      at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (***/__cypress/runner/cypress_runner.js:13460:5)
      at Async.drainQueues (***/__cypress/runner/cypress_runner.js:13330:14)
  From Your Spec Code:
      at taskSpecEnvelopes (***/__cypress/tests?p=cypress/***/specifications/specifications.feature:14009:14)
      at Context.beforeHandler (***/__cypress/tests?p=cypress/***/specifications/specifications.feature:14375:9)
      at Context.eval (***/__cypress/tests?p=cypress/***/specifications/specifications.feature:14070:27)
  
  From Node.js Internals:
    TypeError: state.messages.findLastIndex is not a function
        at specEnvelopesHandler (/home/runner/work/vali/vali/***-tests/node_modules/@badeball/cypress-cucumber-preprocessor/dist/plugin-event-handlers.js:269:57)
        at invoke (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:246:16)
        at <unknown> (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:59:14)
        at tryCatcher (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23)
        at Function.Promise.attempt.Promise.try (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29)
        at Object.wrapChildPromise (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:58:23)
        at RunPlugins.taskExecute (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:252:10)
        at RunPlugins.execute (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:166:21)
        at EventEmitter.<anonymous> (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:56:12)
        at EventEmitter.emit (node:events:527:28)
        at EventEmitter.emit (node:domain:475:12)
        at process.<anonymous> (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
        at process.emit (node:events:527:28)
        at process.emit (node:domain:475:12)
        at process.emit.sharedData.processEmitHook.installedValue [as emit] (/home/runner/.cache/Cypress/12.16.0/Cypress/resources/app/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
        at emit (node:internal/child_process:938:14)
        at processTicksAndRejections (node:internal/process/task_queues:84:21)

I will try to create an issue requesting the Node version update.

@MikeMcC399
Copy link
Collaborator

@ricardo-dematos

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

@maciejmrozinski
Copy link

Which version of Chrome are you guys using? I have similar issue (even when running one cypress instance) when using one of the newest Chrome (with new headless mode): cypress-io/cypress#27264. Maybe this is somehow the same issue.

In my case, it's the one that ubuntu-latest provides, which at the moment is 114.0.5735.198.

Try to force old headless mode for this version of Chrome using --headless=old flag

@CSchulz
Copy link

CSchulz commented Jul 12, 2023

We have with Jenkins on RHEL 8 and Chrome 114.0.5735.133 with Cypress 12.16.0 and 12.17.0 the same issues like mentioned above.
I think it is not related to the github-action itself.

After the last test it hangs in the profiler. We have to manually kill the

[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    0    │     'Chrome'      │      11      │ '215167, 215179, 215180, 215206, 215262, 215208 ... 5 more items' │    3.41    │      8.68      │  832.04  │   1008.64    │   1266.59   │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    1    │     'cypress'     │      1       │                             '213041'                              │    0.84    │      4.03      │  370.97  │    383.94    │   407.04    │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    2    │ 'electron-shared' │      4       │                 '213075, 213548, 213076, 213769'                  │     0      │       0        │  203.91  │    197.69    │   203.93    │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    3    │     'ffmpeg'      │      1       │                             '270840'                              │    0.51    │      0.91      │  96.02   │    117.23    │   350.31    │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    4    │      'other'      │      2       │                         '279297, 279298'                          │     0      │       0        │   6.37   │     6.3      │    6.55     │
[2023-07-12T03:56:41.929Z]   �[32;1mcypress:server:util:process_profiler �[0m│    5    │      'TOTAL'      │      19      │                                '-'                                │    4.76    │     13.07      │ 1509.31  │    1764.1    │   2137.48   │
[2023-07-12T03:56:41.929Z]   �[32;1mcypress:server:util:process_profiler 

Try to force old headless mode for this version of Chrome using --headless=old flag

Using Cypress 12.16.0 should be equal to it, right?

@maciejmrozinski
Copy link

We have with Jenkins on RHEL 8 and Chrome 114.0.5735.133 with Cypress 12.16.0 and 12.17.0 the same issues like mentioned above. I think it is not related to the github-action itself.

After the last test it hangs in the profiler. We have to manually kill the

[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    0    │     'Chrome'      │      11      │ '215167, 215179, 215180, 215206, 215262, 215208 ... 5 more items' │    3.41    │      8.68      │  832.04  │   1008.64    │   1266.59   │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    1    │     'cypress'     │      1       │                             '213041'                              │    0.84    │      4.03      │  370.97  │    383.94    │   407.04    │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    2    │ 'electron-shared' │      4       │                 '213075, 213548, 213076, 213769'                  │     0      │       0        │  203.91  │    197.69    │   203.93    │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    3    │     'ffmpeg'      │      1       │                             '270840'                              │    0.51    │      0.91      │  96.02   │    117.23    │   350.31    │
[2023-07-12T03:56:41.928Z]   �[32;1mcypress:server:util:process_profiler �[0m│    4    │      'other'      │      2       │                         '279297, 279298'                          │     0      │       0        │   6.37   │     6.3      │    6.55     │
[2023-07-12T03:56:41.929Z]   �[32;1mcypress:server:util:process_profiler �[0m│    5    │      'TOTAL'      │      19      │                                '-'                                │    4.76    │     13.07      │ 1509.31  │    1764.1    │   2137.48   │
[2023-07-12T03:56:41.929Z]   �[32;1mcypress:server:util:process_profiler 

Try to force old headless mode for this version of Chrome using --headless=old flag

Using Cypress 12.16.0 should be equal to it, right?

Check changeleg, there is more info about headless flag: https://docs.cypress.io/guides/references/changelog#12-15-0

You can use Chrome version < 112 or force headless flag value. For now, we're testing Cypress 12.17.0, Chrome 114 and headless=old flag and issue does not arise. It's an issue with this new headless version of Chrome (maybe Chrome Remote Interface) vs Cypress.

@maciejmrozinski
Copy link

There is something wrong with run --headless=old because Cypress is reporting that you're running isHeadless: false, isHeaded: true

@MikeMcC399
Copy link
Collaborator

@maciejmrozinski

It's an issue with this new headless version of Chrome (maybe Chrome Remote Interface) vs Cypress.

I suspect that there are multiple root causes of job hangs. I also doubt that the hangs are primarily caused by the github-action itself. If test runs are failing on a GitHub-hosted or self-hosted runner and passing when run on a local machine, then I feel it is more likely to be due to timing and hardware dimensioning.

@MikeMcC399
Copy link
Collaborator

We haven't had any feedback from the Cypress team on this issue so far and the original poster @gigamesh of this older issue said that the issue is not relevant to him anymore and the issue could be closed.

If any of the contributors here are able to post a reproducible example, then there would be a much higher likelihood that the issue could be better investigated. It would probably make sense to post any reproducible setup into a separate issue for clarity in debugging.

@cacieprins
Copy link

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!

@nagash77
Copy link
Contributor

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Reproduction We are currently lacking steps to reproduce this scenario reliably
Projects
None yet
Development

No branches or pull requests