add exit to health test

This commit is contained in:
Sonja Happ 2020-10-09 11:32:31 +02:00
parent 32b42a1be0
commit f90aa70a58

View file

@ -29,6 +29,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"net/http"
"os"
"time"
"testing"
)
@ -82,4 +84,8 @@ func TestHealthz(t *testing.T) {
code, resp, err = helper.TestEndpoint(router, "", "healthz", http.MethodGet, nil)
assert.NoError(t, err)
assert.Equalf(t, 200, code, "Response body: \n%v\n", resp)
// exit after 5 seconds
time.Sleep(5)
os.Exit(0)
}