From 3c0ccaafe79375d18e2b7359bb8f6eaee4eb34df Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 18 Oct 2017 09:21:28 -0700 Subject: fix preference test races (#7645) --- api4/preference_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'api4/preference_test.go') diff --git a/api4/preference_test.go b/api4/preference_test.go index 4a68bc804..68d34784f 100644 --- a/api4/preference_test.go +++ b/api4/preference_test.go @@ -252,6 +252,10 @@ func TestUpdatePreferencesWebsocket(t *testing.T) { } WebSocketClient.Listen() + time.Sleep(300 * time.Millisecond) + if resp := <-WebSocketClient.ResponseChannel; resp.Status != model.STATUS_OK { + t.Fatal("should have responded OK to authentication challenge") + } userId := th.BasicUser.Id preferences := &model.Preferences{ @@ -371,6 +375,10 @@ func TestDeletePreferencesWebsocket(t *testing.T) { } WebSocketClient.Listen() + time.Sleep(300 * time.Millisecond) + if resp := <-WebSocketClient.ResponseChannel; resp.Status != model.STATUS_OK { + t.Fatal("should have responded OK to authentication challenge") + } _, resp = th.Client.DeletePreferences(userId, preferences) CheckNoError(t, resp) -- cgit v1.2.3-1-g7c22