From f90aa70a58fa7f6836a24f4637ab58ecf322182a Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Fri, 9 Oct 2020 11:32:31 +0200 Subject: [PATCH] add exit to health test --- routes/healthz/healthz_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routes/healthz/healthz_test.go b/routes/healthz/healthz_test.go index e0e5e5d..32f4838 100644 --- a/routes/healthz/healthz_test.go +++ b/routes/healthz/healthz_test.go @@ -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) }