mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
Fix errcheck issues in server/channels/app/platform/busy_test.go (#29318)
This commit is contained in:
parent
2d21f44ede
commit
e5a4b1efba
2 changed files with 8 additions and 5 deletions
|
|
@ -101,7 +101,6 @@ issues:
|
|||
channels/app/migrations.go|\
|
||||
channels/app/permissions.go|\
|
||||
channels/app/permissions_test.go|\
|
||||
channels/app/platform/busy_test.go|\
|
||||
channels/app/platform/cluster_handlers.go|\
|
||||
channels/app/platform/config_test.go|\
|
||||
channels/app/platform/helper_test.go|\
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
func TestBusySet(t *testing.T) {
|
||||
cluster := &ClusterMock{Busy: &Busy{}}
|
||||
cluster := &ClusterMock{Busy: &Busy{}, t: t}
|
||||
busy := NewBusy(cluster)
|
||||
|
||||
isNotBusy := func() bool {
|
||||
|
|
@ -54,7 +54,7 @@ func TestBusySet(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestBusyExpires(t *testing.T) {
|
||||
cluster := &ClusterMock{Busy: &Busy{}}
|
||||
cluster := &ClusterMock{Busy: &Busy{}, t: t}
|
||||
busy := NewBusy(cluster)
|
||||
|
||||
isNotBusy := func() bool {
|
||||
|
|
@ -90,7 +90,7 @@ func TestBusyExpires(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestBusyRace(t *testing.T) {
|
||||
cluster := &ClusterMock{Busy: &Busy{}}
|
||||
cluster := &ClusterMock{Busy: &Busy{}, t: t}
|
||||
busy := NewBusy(cluster)
|
||||
|
||||
busy.Set(500 * time.Millisecond)
|
||||
|
|
@ -119,11 +119,15 @@ func compareBusyState(t *testing.T, busy1 *Busy, busy2 *Busy) bool {
|
|||
// ClusterMock simulates the busy state of a cluster.
|
||||
type ClusterMock struct {
|
||||
Busy *Busy
|
||||
t *testing.T
|
||||
}
|
||||
|
||||
func (c *ClusterMock) SendClusterMessage(msg *model.ClusterMessage) {
|
||||
var sbs model.ServerBusyState
|
||||
json.Unmarshal(msg.Data, &sbs)
|
||||
err := json.Unmarshal(msg.Data, &sbs)
|
||||
if err != nil {
|
||||
require.NoError(c.t, err)
|
||||
}
|
||||
c.Busy.ClusterEventChanged(&sbs)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue