From 0de9a7b0d652137442b82c03cea8ce0e3670776b Mon Sep 17 00:00:00 2001 From: Umputun Date: Thu, 4 Apr 2019 09:37:28 -0500 Subject: [PATCH] set longer time to start integration server test --- backend/app/main_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app/main_test.go b/backend/app/main_test.go index d9385171..0409ed95 100644 --- a/backend/app/main_test.go +++ b/backend/app/main_test.go @@ -16,13 +16,13 @@ import ( "github.com/stretchr/testify/require" ) -func TestMain(t *testing.T) { +func Test_Main(t *testing.T) { os.Args = []string{"test", "server", "--secret=123456", "--store.bolt.path=/tmp/xyz", "--backup=/tmp", "--avatar.fs.path=/tmp", "--port=18202", "--url=https://demo.remark42.com", "--dbg", "--notify.type=none"} go func() { - time.Sleep(500 * time.Millisecond) + time.Sleep(1000 * time.Millisecond) err := syscall.Kill(syscall.Getpid(), syscall.SIGTERM) require.Nil(t, err) }() @@ -32,11 +32,11 @@ func TestMain(t *testing.T) { go func() { st := time.Now() main() - assert.True(t, time.Since(st).Seconds() < 1, "should take about 500msec") + assert.True(t, time.Since(st).Seconds() < 2, "should take under 1s") wg.Done() }() - time.Sleep(200 * time.Millisecond) // let server start + time.Sleep(500 * time.Millisecond) // let server start // send ping resp, err := http.Get("http://localhost:18202/api/v1/ping")