Refactor health checks and wait until NGINX process ends

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-09-01 14:21:24 -04:00
parent c85450c1e7
commit c2935ca35c
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
15 changed files with 126 additions and 69 deletions

View file

@ -35,12 +35,11 @@ import (
func TestNginxCheck(t *testing.T) {
mux := http.NewServeMux()
listener, err := net.Listen("unix", nginx.StatusSocket)
listener, err := net.Listen("tcp", fmt.Sprintf(":%v", nginx.StatusPort))
if err != nil {
t.Fatalf("crating unix listener: %s", err)
t.Fatalf("crating tcp listener: %s", err)
}
defer listener.Close()
defer os.Remove(nginx.StatusSocket)
server := &httptest.Server{
Listener: listener,