github-action
github-action copied to clipboard
Cypress always times out on Github Actions [Help Request]
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 }}
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'
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.
I also get a time out on my job whenever I try to set the node version to 18. It works fine on 14.
Same for me, nothing happens on 18 but works fine in 16.16
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.
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.
Same for me. Solved it by replacing
localhostwith127.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.
- This is related also to issue https://github.com/cypress-io/github-action/issues/802
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