cypress-io / cypress-io/github-action
Ping every second or every N seconds
- Dominant language
- JavaScript
- Stars
- 1.5k
- Forks
- 353
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 27
Description
Right now we ping the wait-on URL every second if we get `ECONNREFUSED`
If we get other error codes we ping the URL every 30 seconds, which seems like a long interval
Probably would be nicer to always ping at 5 second or 10 second intervals
```
2021-03-30T14:02:03.4548335Z ##[debug]parsed command: npm run start-after-50-seconds
2021-03-30T14:02:03.4549148Z waiting on "http://localhost:3050" with timeout of 60 seconds
2021-03-30T14:02:03.4550210Z ##[debug]Waiting for urls http://localhost:3050
2021-03-30T14:02:03.4551019Z ##[debug]Waiting for url http://localhost:3050
2021-03-30T14:02:03.4551548Z ##[debug]total ping timeout 60000
2021-03-30T14:02:03.4552208Z ##[debug]individual ping timeout 30000ms
2021-03-30T14:02:03.4552893Z ##[debug]retries limit 2
2021-03-30T14:02:03.4553670Z ##[debug]got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1617112921156,"socket":1617112921157,"lookup":1617112921158,"error":1617112921159,"phases":{"wait":1,"dns":1,"total":3}}}
2021-03-30T14:02:03.4554875Z ##[debug]14ms undefined undefined ECONNREFUSED attempt 1
2021-03-30T14:02:03.4555434Z ##[debug]found command "/usr/local/bin/npm"
2021-03-30T14:02:03.4556444Z ##[debug]with arguments run start-after-50-seconds
2021-03-30T14:02:03.4557661Z ##[debug]running "/usr/local/bin/npm" run start-after-50-seconds in /home/runner/work/github-action/github-action/examples/wait-on
2021-03-30T14:02:03.4558707Z ##[debug]waiting for the command to finish? false
2021-03-30T14:02:03.4563385Z [command]/usr/local/bin/npm run start-after-50-seconds
2021-03-30T14:02:03.4564608Z ##[debug]got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1617112922168,"socket":1617112922169,"lookup":1617112922169,"error":1617112922169,"phases":{"wait":1,"dns":0,"total":1}}}
2021-03-30T14:02:03.4567010Z ##[debug]1017ms undefined undefined ECONNREFUSED attempt 2
2021-03-30T14:02:03.4568401Z ##[debug]got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1617112923171,"socket":1617112923171,"lookup":1617112923172,"error":1617112923172,"phases":{"wait":0,"dns":1,"total":1}}}
2021-03-30T14:02:03.4569808Z ##[debug]2020ms undefined undefined ECONNREFUSED attempt 3
2021-03-30T14:02:04.1758168Z ##[debug]got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1617112924174,"socket":1617112924174,"lookup":1617112924174,"error":1617112924175,"phases":{"wait":0,"dns":0,"total":1}}}
2021-03-30T14:02:04.1759699Z ##[debug]3023ms undefined undefined ECONNREFUSED attempt 4
2021-03-30T14:02:05.1788683Z ##[debug]got error {"name":"RequestError","code":"ECONNREFUSED","timings":{"start":1617112925177,"socket":1617112925177,"lookup":1617112925177,"error":1617112925178,"phases":{"wait":0,"dns":0,"total":1}}}
2021-03-30T14:02:05.1789541Z ##[debug]4026ms undefined undefined ECONNREFUSED attempt 5
2021-03-30T14:02:05.2395263Z
2021-03-30T14:02:05.2397088Z > example-wait-on@1.0.0 start-after-50-seconds /home/runner/work/github-action/github-action/examples/wait-on
2021-03-30T14:02:05.2398345Z > node ./index2 --delay 50
2021-03-30T14:02:05.2398841Z
2021-03-30T14:02:05.2985205Z 2021-03-30T14:02:05.297Z * creating the server on port 3050
2021-03-30T14:02:05.3002575Z 2021-03-30T14:02:05.298Z * will respond with errors for 50 seconds
2021-03-30T14:02:05.3023616Z 2021-03-30T14:02:05.302Z * server is listening
2021-03-30T14:02:06.1848377Z 2021-03-30T14:02:06.184Z * request GET /
2021-03-30T14:02:06.1849349Z 2021-03-30T14:02:06.184Z * responding with error
2021-03-30T14:02:06.1902679Z ##[debug]got error {"name":"HTTPError","timings":{"start":1617112926180,"socket":1617112926181,"lookup":1617112926181,"connect":1617112926181,"upload":1617112926181,"response":1617112926186,"end":1617112926188,"phases":{"wait":1,"dns":0,"tcp":0,"request":0,"firstByte":5,"download":2,"total":8}}}
2021-03-30T14:02:06.1904951Z ##[debug]5038ms undefined undefined undefined attempt 6
2021-03-30T14:02:36.1993550Z 2021-03-30T14:02:36.198Z * request GET /
2021-03-30T14:02:36.1997189Z 2021-03-30T14:02:36.198Z * responding with error
2021-03-30T14:02:36.1998744Z ##[debug]got error {"name":"HTTPError","timings":{"start":1617112956196,"socket":1617112956196,"lookup":1617112956196,"connect":1617112956197,"upload":1617112956197,"response":1617112956198,"end":1617112956198,"phases":{"wait":0,"dns":0,"tcp":1,"request":0,"firstByte":1,"download":0,"total":2}}}
2021-03-30T14:02:36.1999863Z ##[debug]35047ms undefined undefined undefined attempt 7
2021-03-30T14:03:06.2289936Z 2021-03-30T14:03:06.228Z * request GET /
2021-03-30T14:03:06.2290939Z 2021-03-30T14:03:06.228Z * responding all good
2021-03-30T14:03:06.2305176Z ##[debug]pinging http://localhost:3050 has finished ok after 65078ms
```
Contributor guide
Assessment
This issue has not been assessed yet.