connection refused errors are expectede
This commit is contained in:
parent
8060336110
commit
eb6bada57c
@ -9,6 +9,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ import (
|
|||||||
type response struct {
|
type response struct {
|
||||||
Sleep time.Duration
|
Sleep time.Duration
|
||||||
Pid int
|
Pid int
|
||||||
Error string `json:,omitempty`
|
Error string `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func wait(wg *sync.WaitGroup, url string) {
|
func wait(wg *sync.WaitGroup, url string) {
|
||||||
@ -28,6 +29,8 @@ func wait(wg *sync.WaitGroup, url string) {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
// we expect connection refused
|
||||||
|
if !strings.HasSuffix(err.Error(), "connection refused") {
|
||||||
e2 := json.NewEncoder(os.Stderr).Encode(&response{
|
e2 := json.NewEncoder(os.Stderr).Encode(&response{
|
||||||
Error: err.Error(),
|
Error: err.Error(),
|
||||||
Pid: os.Getpid(),
|
Pid: os.Getpid(),
|
||||||
@ -38,6 +41,7 @@ func wait(wg *sync.WaitGroup, url string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func httpsServer(addr string) *http.Server {
|
func httpsServer(addr string) *http.Server {
|
||||||
cert, err := tls.X509KeyPair(localhostCert, localhostKey)
|
cert, err := tls.X509KeyPair(localhostCert, localhostKey)
|
||||||
|
Loading…
Reference in New Issue
Block a user