question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress always times out on Github Actions [Help Request]

See original GitHub issue

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 }}

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:8
  • Comments:6

github_iconTop GitHub Comments

6reactions
ninaolocommented, 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.

3reactions
TomCodePeoplecommented, May 3, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Actions - Cypress Documentation
The Cypress team maintains the official Cypress GitHub Action for running Cypress tests. This action provides npm installation, custom caching, additional ...
Read more >
Complete Guide To Cypress Testing With GitHub Actions
Read on this blog to learn how to set up CI/CD pipeline for test cases using Cypress with GitHub Actions.
Read more >
Recording with GitHub Actions - Docs
Using Replay's action-cypress in your GitHub Actions workflow is the easiest way to get started recording your Cypress tests in CI.
Read more >
cypress-io/cypress - Gitter
Should this custom command work to send a default timeout of 6s to the get command ... I was able to test locally...
Read more >
Cypress and Flaky Tests: How to Handle Timeout Errors
In the context of testing a web application, a timeout error may occur when the app runs an asynchronous operation that must complete...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found