diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-06-21 05:05:13 +0800 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-06-20 17:05:13 -0400 |
commit | 14054a532d090632f7505ebf38a24f24645a8656 (patch) | |
tree | a4b42ca4285581c07579781b16e197b176de382d | |
parent | b5d2c12d225664af5387bcc628b37502ef74c205 (diff) | |
download | chat-14054a532d090632f7505ebf38a24f24645a8656.tar.gz chat-14054a532d090632f7505ebf38a24f24645a8656.tar.bz2 chat-14054a532d090632f7505ebf38a24f24645a8656.zip |
fix intermittent failure of TestGetPostsForChannel on CI server (#6702)
-rw-r--r-- | api4/post_test.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/api4/post_test.go b/api4/post_test.go index f2f18fbe8..bfc0c286a 100644 --- a/api4/post_test.go +++ b/api4/post_test.go @@ -363,7 +363,9 @@ func TestGetPostsForChannel(t *testing.T) { post3 := &model.Post{ChannelId: th.BasicChannel.Id, Message: "zz" + model.NewId() + "a", RootId: post1.Id} post3, _ = Client.CreatePost(post3) - time := model.GetMillis() + time.Sleep(300 * time.Millisecond) + since := model.GetMillis() + time.Sleep(300 * time.Millisecond) post4 := th.CreatePost() @@ -420,7 +422,7 @@ func TestGetPostsForChannel(t *testing.T) { post5 := th.CreatePost() - posts, resp = Client.GetPostsSince(th.BasicChannel.Id, time) + posts, resp = Client.GetPostsSince(th.BasicChannel.Id, since) CheckNoError(t, resp) if len(posts.Posts) != 2 { @@ -430,7 +432,7 @@ func TestGetPostsForChannel(t *testing.T) { found := make([]bool, 2) for _, p := range posts.Posts { - if p.CreateAt < time { + if p.CreateAt < since { t.Fatal("bad create at for post returned") } if p.Id == post4.Id { |