From 08ea544bdc533d9e6367b3b051a01d8ac940466a Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 4 Nov 2018 12:35:16 -0600 Subject: [PATCH] missing wait for app completion in SSL server test --- backend/app/cmd/server_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/app/cmd/server_test.go b/backend/app/cmd/server_test.go index 7ff7c0c2..5bc9cde4 100644 --- a/backend/app/cmd/server_test.go +++ b/backend/app/cmd/server_test.go @@ -148,7 +148,7 @@ func TestServerApp_WithSSL(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) go func() { - time.Sleep(5 * time.Second) + time.Sleep(1 * time.Second) log.Print("[TEST] terminate app") cancel() }() @@ -182,6 +182,8 @@ func TestServerApp_WithSSL(t *testing.T) { body, err := ioutil.ReadAll(resp.Body) assert.Nil(t, err) assert.Equal(t, "pong", string(body)) + + app.Wait() } func TestServerApp_Failed(t *testing.T) { @@ -245,7 +247,7 @@ func TestServerApp_Shutdown(t *testing.T) { func TestServerApp_MainSignal(t *testing.T) { go func() { - time.Sleep(200 * time.Millisecond) + time.Sleep(250 * time.Millisecond) err := syscall.Kill(syscall.Getpid(), syscall.SIGTERM) require.Nil(t, err) }()