From 46244b855a2bd7d354df8a9d54da3cce778cb7d4 Mon Sep 17 00:00:00 2001 From: Umputun Date: Tue, 9 Apr 2019 14:17:08 -0500 Subject: [PATCH] make main test slower for unusually slow travis storage init time(?) --- 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 219f9b73..7c8055c6 100644 --- a/backend/app/main_test.go +++ b/backend/app/main_test.go @@ -28,7 +28,7 @@ func Test_Main(t *testing.T) { "--avatar.fs.path=" + dir, "--port=18222", "--url=https://demo.remark42.com", "--dbg", "--notify.type=none"} go func() { - time.Sleep(2000 * time.Millisecond) + time.Sleep(5000 * time.Millisecond) e := syscall.Kill(syscall.Getpid(), syscall.SIGTERM) require.Nil(t, e) }() @@ -38,12 +38,12 @@ func Test_Main(t *testing.T) { go func() { st := time.Now() main() - assert.True(t, time.Since(st).Seconds() > 2, "should take 2s") + assert.True(t, time.Since(st).Seconds() >= 5, "should take about 5s") wg.Done() }() var passed bool - err = repeater.NewDefault(10, time.Millisecond*200).Do(context.Background(), func() error { + err = repeater.NewDefault(10, time.Millisecond*500).Do(context.Background(), func() error { resp, e := http.Get("http://localhost:18222/api/v1/ping") if e != nil { t.Logf("%+v", e) @@ -60,7 +60,7 @@ func Test_Main(t *testing.T) { }) assert.NoError(t, err) - assert.Equal(t, true, passed) + assert.Equal(t, true, passed, "at least on ping passed") wg.Wait() }