Times out in Github Action
See original GitHub issueBug Report
I am running version 1.11.6
. My server is nodejs, rendering server side EJS templates. I am using Nightwatch for tests. My scripts are:
ci: start-server-and-test start http-get://localhost:8080 test:e2e
start: node server.js
"test:e2e": "nightwatch --env default --headless"
Running npm run ci
works perfectly locally, but when I run in a Github Action pipeline it is timing out. As you can see, I am logging a confirmation that our express server is up and running. I am getting the following error.
> start-server-and-test start http-get://localhost:8080 test:e2e
1: starting server using command "npm run start"
and when url "[ 'http-get://localhost:8080' ]" is responding with HTTP status code 200
running tests using command "npm run test:e2e"
> project@1.0.0 start /home/runner/work/project/project
> node server.js
Express server listening on port 8080
Error: Timed out waiting for: http://localhost:8080
at MergeMapSubscriber.project (/home/runner/work/project/project/node_modules/wait-on/lib/wait-on.js:130:25)
at MergeMapSubscriber._tryNext (/home/runner/work/project/project/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
at MergeMapSubscriber._next (/home/runner/work/project/project/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
at MergeMapSubscriber.Subscriber.next (/home/runner/work/project/project/node_modules/rxjs/internal/Subscriber.js:66:18)
at AsyncAction.dispatch [as work] (/home/runner/work/project/project/node_modules/rxjs/internal/observable/timer.js:31:16)
at AsyncAction._execute (/home/runner/work/project/project/node_modules/rxjs/internal/scheduler/AsyncAction.js:71:18)
at AsyncAction.execute (/home/runner/work/project/project/node_modules/rxjs/internal/scheduler/AsyncAction.js:59:26)
at AsyncScheduler.flush (/home/runner/work/project/project/node_modules/rxjs/internal/scheduler/AsyncScheduler.js:52:32)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tfiiu@1.0.0 ci: `start-server-and-test start http-get://localhost:8080 test:e2e`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tfiiu@1.0.0 ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2020-11-20T16_38_11_687Z-debug.log
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
GitHub Actions step is hanging until timeout · Issue #1326
At some point, a GitHub Actions step stops producing output and hangs until the workflow is terminated by timeout. You can see the...
Read more >Set default Timeout on Github action pipeline - Stack Overflow
Recently, for some strange reasons, some pipelines take between 45 minutes and 6 hours to fail. Is it possible to set a default...
Read more >GitHub Actions timeout parameter
We often set a “pip” timeout of 1 or 2 minutes to ensure the CI is using wheels instead of compiling from source,...
Read more >Adding Timeout to Github Actions - Mark Fontenot
To add a timeout to a Github Actions Workflow, add the timeout-minutes to the workflow YAML file. See the red box in the...
Read more >GitHub Actions import solution workflow timeout
GitHub Actions import solution workflow timeout. 05-22-2022 06:21 AM. Hi. I'm trying to set up automation for solution import/export using this tutorial ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Im just getting this on repeat with debug output on…
making HTTP(S) head request to url:http://localhost:8081/ ... HTTP(S) error for http://localhost:8081/ Error: connect ECONNREFUSED 127.0.0.1:8081
However localhost:8081 should be responding, just not doing it for the script for some reason
If you have any kind of response (500 in this case), most likely the issue is coming from the server itself that behaves differently on CI.
There is also an upstream issue, btw: https://github.com/jeffbski/wait-on/issues/86.
You can also try replacing
start-server-and-test start <url> test
withconcurrently
+wait-on
: