From 9be9cf8d9d82e221aa6ce5f3148f2a0c487c6e54 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 5 Jul 2015 23:52:07 -0800 Subject: adding debugging --- api/user_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/api/user_test.go b/api/user_test.go index 522ff05d5..dbd72a2b3 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -474,6 +474,8 @@ func TestUserUpdate(t *testing.T) { time2 := model.GetMillis() + time.Sleep(100 * time.Millisecond) + user.FullName = "Jim Jimmy" user.TeamId = "12345678901234567890123456" user.LastActivityAt = time2 @@ -490,13 +492,12 @@ func TestUserUpdate(t *testing.T) { if result.Data.(*model.User).TeamId != team.Id { t.Fatal("TeamId should not have updated") } - // BAD TESTS BECAUSE OF RACE CONDITION - // if result.Data.(*model.User).LastActivityAt != time1 { - // t.Fatal("LastActivityAt should not have updated") - // } - // if result.Data.(*model.User).LastPingAt != time1 { - // t.Fatal("LastPingAt should not have updated") - // } + if result.Data.(*model.User).LastActivityAt == time2 { + t.Fatal("LastActivityAt should not have updated") + } + if result.Data.(*model.User).LastPingAt == time2 { + t.Fatal("LastPingAt should not have updated") + } if result.Data.(*model.User).Roles != "" { t.Fatal("Roles should not have updated") } -- cgit v1.2.3-1-g7c22