Ping every second or every N seconds

Aperta
#333 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
github-actions, javascript, node.js
Ambito
ci-cd, devtools

Direzione di ricerca

Inizia riproducendo il comportamento con il comando examples/wait-on npm run start-after-50-seconds e il relativo punto di ingresso node ./index2 --delay 50, quindi individua la logica di retry degli URL di wait-on. Il lavoro è completato quando gli errori diversi da ECONNREFUSED vengono ritentati a un intervallo costante di 5 o 10 secondi, come richiesto, e l’attesa dimostrata ha esito positivo entro il proprio timeout.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

topic: waiting type: enhancement

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 > [email protected] 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
Lingua principale
JavaScript
Stelle
1.5k
Fork
356
Merge medio
1g 9h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cypress-io/github-action

Tutte le issue di cypress-io/github-action

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.