* fix spurious TestMuteCommandSpecificChannel test failure

See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw

* fix race in TestExportUserChannels

* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
Этот коммит содержится в:
Jesse Hallam
2019-01-09 14:01:24 -05:00
коммит произвёл Harrison Healey
родитель 343a1d67e9
Коммит 66d174d80b
3 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/store"
"github.com/stretchr/testify/require"
)
@@ -78,12 +79,7 @@ func TestExportUserChannels(t *testing.T) {
}
var preferences model.Preferences
preferences = append(preferences, preference)
channelMember := model.ChannelMember{
ChannelId: channel.Id,
UserId: user.Id,
}
th.App.Srv.Store.Channel().SaveMember(&channelMember)
th.App.Srv.Store.Preference().Save(&preferences)
store.Must(th.App.Srv.Store.Preference().Save(&preferences))
th.App.UpdateChannelMemberNotifyProps(notifyProps, channel.Id, user.Id)
exportData, err := th.App.buildUserChannelMemberships(user.Id, team.Id)
require.Nil(t, err)