[MM-27700] storetest/channel_store: fix flaky test for search too short term (#15242)

* storetest/channel_store: fix flaky test for search too short term

* storetest/channel_store: use another stop word instead

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Ibrahim Serdar Acikgoz
2020-08-17 11:19:29 +03:00
committed by GitHub
parent 1fadfa9f33
commit 9211a8b9d3

View File

@@ -31,7 +31,8 @@ func cleanupChannels(t *testing.T, ss store.Store) {
list, err := ss.Channel().GetAllChannels(0, 100000, store.ChannelSearchOpts{IncludeDeleted: true})
require.Nilf(t, err, "error cleaning all channels: %v", err)
for _, channel := range *list {
ss.Channel().PermanentDelete(channel.Id)
err = ss.Channel().PermanentDelete(channel.Id)
assert.NoError(t, err)
}
}
@@ -5373,8 +5374,8 @@ func testChannelStoreSearchAllChannels(t *testing.T, ss store.Store) {
o10 := model.Channel{
TeamId: t1.Id,
DisplayName: "B10 The",
Name: "the",
DisplayName: "B10 That",
Name: "that",
Type: model.CHANNEL_OPEN,
}
_, nErr = ss.Channel().Save(&o10, -1)
@@ -5440,7 +5441,7 @@ func testChannelStoreSearchAllChannels(t *testing.T, ss store.Store) {
{"prefix", "off-", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o6, &o7, &o8}, 0},
{"full match with dash", "off-topic", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o6}, 0},
{"town square", "town square", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o9}, 0},
{"the in name", "the", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o10}, 0},
{"that in name", "that", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o10}, 0},
{"Mobile", "Mobile", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o11}, 0},
{"search purpose", "now searchable", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o12}, 0},
{"pipe ignored", "town square |", store.ChannelSearchOpts{IncludeDeleted: false}, &model.ChannelList{&o9}, 0},