MM-9664 Add invalidation metrics for store caches (#8340)

* Add invalidation metrics for store caches

* Increment session invalidation metric

* Fix tests
This commit is contained in:
Joram Wilander
2018-03-05 10:35:26 -05:00
committed by GitHub
parent fbff94f3be
commit 4a1802c039
16 changed files with 130 additions and 36 deletions

View File

@@ -13,7 +13,6 @@ import (
"testing"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/store/sqlstore"
)
func TestCreateChannel(t *testing.T) {
@@ -909,7 +908,7 @@ func TestDeleteChannel(t *testing.T) {
// successful delete by channel admin
th.MakeUserChannelAdmin(user, publicChannel6)
th.MakeUserChannelAdmin(user, privateChannel7)
sqlstore.ClearChannelCaches()
th.App.Srv.Store.Channel().ClearCaches()
_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckNoError(t, resp)
@@ -960,7 +959,7 @@ func TestDeleteChannel(t *testing.T) {
// // cannot delete by channel admin
th.MakeUserChannelAdmin(user, publicChannel6)
th.MakeUserChannelAdmin(user, privateChannel7)
sqlstore.ClearChannelCaches()
th.App.Srv.Store.Channel().ClearCaches()
_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckForbiddenStatus(t, resp)
@@ -1001,7 +1000,7 @@ func TestDeleteChannel(t *testing.T) {
// cannot delete by channel admin
th.MakeUserChannelAdmin(user, publicChannel6)
th.MakeUserChannelAdmin(user, privateChannel7)
sqlstore.ClearChannelCaches()
th.App.Srv.Store.Channel().ClearCaches()
_, resp = Client.DeleteChannel(publicChannel6.Id)
CheckForbiddenStatus(t, resp)