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

Cypress always times out on Github Actions [Help Request] #534

Closed
ml242 opened this issue Apr 8, 2022 · 9 comments
Closed

Cypress always times out on Github Actions [Help Request] #534

ml242 opened this issue Apr 8, 2022 · 9 comments
Labels
documentation Improvements or additions to documentation

Comments

@ml242
Copy link

ml242 commented Apr 8, 2022

My flow was working fine and I have not changed any settings, but now it times out on every PR. I look through the commits and it sure seems like nothing has changed, anyway.

Outside of opening a PR without my cypress.yml, and then putting it back in, is there anything else I can check to see why it wouldn't run? I have tried the various flavors of cypress 9.x.x and that has no impact.

Thanks for any insight.

Here is my YML


on: [pull_request]
env: 
  CYPRESS_REACT_APP_API_URL: https:/xxxxx
  REACT_APP_API_URL: xxxxxxxx
jobs:
  cypress-run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup kernel and increase watchers
        run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
      # Install NPM dependencies, cache them correctly
      # and run all Cypress tests
      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          quiet: false
          browser: chrome
          headless: true
          record: false
          start: npm start
          wait-on: http://localhost:3000
          wait-on-timeout: 180
          env: true
        env:
          REACT_APP_RECAPTCHA_SITE_KEY: xxxxxx
          CYPRESS_REACT_APP_API_URL:xxxxx
          REACT_APP_API_URL: xxxxx
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@tomfriedhof
Copy link

I ran into this issue as well. Setting the node version to 16 worked for me:

- uses: actions/setup-node@v2
  with:
    node-version: '16'

@TomCodePeople
Copy link

Unfortunately I am also experiencing this issue. I wanted to run Cypress on Node v18. This also caused a timeout. LTS version 16.15.0 is working.

One of the differences I see in logs (Before there was also a network address.):

App running at:
  - Local:   http://localhost:8081 
  - Network: unavailable

Full error log:

Error: Timed out waiting for: http://localhost:8081
    at {runner path}/node_modules/wait-on/lib/wait-on.js:132:31
    at doInnerSub ({runner path}/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:22:31)
    at outerNext ({runner path}/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:17:70)
    at OperatorSubscriber._this._next ({runner path}/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:33:21)
    at Subscriber.next ({runner path}/node_modules/rxjs/dist/cjs/internal/Subscriber.js:51:18)
    at AsyncAction.work ({runner path}/node_modules/rxjs/dist/cjs/internal/observable/timer.js:28:28)
    at AsyncAction._execute ({runner path}/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js:76:18)
    at AsyncAction.execute ({runner path}/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js:64:26)
    at AsyncScheduler.flush ({runner path}/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncScheduler.js:39:33)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)

Setup package.json:
scripts:

...
"serve": "vue-cli-service serve",
"test:e2e": "start-server-and-test serve 8081 test",
"test": "npm-run-all pre-test run-test post-test --continue-on-error",
"pre-test": "rimraf cypress/results/*",
"run-test": "cypress run --reporter mochawesome --reporter-options reportDir=cypress/results,overwrite=false,html=false,json=true",
    "post-test": "npx mochawesome-merge 'cypress/results/*.json' > cypress/report/mochawesome.json && npx marge -o cypress/report -f awa_cypress_report cypress/report/mochawesome.json"

devDependencies:

...
"@vue/cli-service": "^5.0.4",
"cypress": "9.6.0",
"mochawesome": "^7.0.1",
"mochawesome-merge": "^4.2.1",

If you want to know more scripts and package versions, let me know.

@camjackson
Copy link

I also get a time out on my job whenever I try to set the node version to 18. It works fine on 14.

@flerpo
Copy link

flerpo commented Aug 23, 2022

Same for me, nothing happens on 18 but works fine in 16.16

@ninaolo
Copy link

ninaolo commented Oct 14, 2022

Same for me. Solved it by replacing localhost with 127.0.0.1.

From the Cypress changelog:

The default webpack configuration's host value was changed from localhost to 127.0.0.1 to support the Node 17+ changes with how DNS names are resolved. Addressed in #21430.

@ManuC84
Copy link

ManuC84 commented Nov 2, 2022

Did you end up solving this? I have Cypress running fine on local but it times out in the CI. I'm using node 16 for github actions.

MrCoder added a commit to ZenUml/core that referenced this issue Dec 22, 2022
karthikbtf added a commit to terraware/terraware-web that referenced this issue Feb 20, 2023
See cypress-io/github-action#534 (comment) (thanks @charlie-tf )

The default webpack configuration's host value was changed from localhost to 127.0.0.1 to support the Node 17+ changes with how DNS names are resolved. Addressed in cypress-io/cypress#21430.
@solita-shamsur
Copy link

Same for me. Solved it by replacing localhost with 127.0.0.1.

From the Cypress changelog:

The default webpack configuration's host value was changed from localhost to 127.0.0.1 to support the Node 17+ changes with how DNS names are resolved. Addressed in #21430.

This worked for me too.

@MikeMcC399
Copy link
Collaborator

danjov added a commit to GeoWerkstatt/ews-boda that referenced this issue Mar 16, 2023
The issue was caused by a configuration change by webpack.

See cypress-io/github-action#534
@MikeMcC399 MikeMcC399 added the documentation Improvements or additions to documentation label Nov 4, 2023
@MikeMcC399
Copy link
Collaborator

There are related suggestions now added to the documentation

https://github.com/cypress-io/github-action/blob/master/README.md#wait-on-with-nodejs-18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

9 participants