From fe43fdb4ae96243115a8fa6c3d11a42c89304d01 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 9 Oct 2020 23:52:32 +0200 Subject: [PATCH] TestHTTPServe was loading templates two times --- web/web_test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/web/web_test.go b/web/web_test.go index cc0cbec..15b1d86 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -8,15 +8,10 @@ import ( // TestHTTPServe tries to serve a real HTTP server and load some pages func TestHTTPServe(t *testing.T) { - // Load templates - if err := loadTemplates(); err != nil { - t.Errorf("Failed to load templates: %v", err) - } - go Serve(nil, nil, &Options{Enabled: true, ListenAddress: "127.0.0.1:8081"}) - // Sleep 1 second to ensure that the web server is running, to avoid fails because the request came too early - time.Sleep(1000000000) + // Sleep 500ms to ensure that the web server is running, to avoid fails because the request came too early + time.Sleep(500 * time.Millisecond) // Test GET request resp, err := http.Get("http://localhost:8081/")