From 61d793cb1f1569d954d52b593561a871c6ec040d Mon Sep 17 00:00:00 2001 From: Krasi Georgiev Date: Thu, 14 Dec 2017 13:45:36 +0000 Subject: [PATCH] handle web_test webhandler errors. --- web/web_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/web_test.go b/web/web_test.go index 7b0293543..656814c37 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -108,7 +108,12 @@ func TestReadyAndHealthy(t *testing.T) { opts.Flags = map[string]string{} webHandler := New(nil, opts) - go webHandler.Run(context.Background()) + go func() { + err := webHandler.Run(context.Background()) + if err != nil { + panic(fmt.Sprintf("Can't start web handler:%s", err)) + } + }() // Give some time for the web goroutine to run since we need the server // to be up before starting tests. @@ -202,7 +207,7 @@ func TestRoutePrefix(t *testing.T) { go func() { err := webHandler.Run(context.Background()) if err != nil { - panic(fmt.Sprintf("Can't start webhandler error %s", err)) + panic(fmt.Sprintf("Can't start web handler:%s", err)) } }()