diff --git a/cmd/mattermost/commands/server_test.go b/cmd/mattermost/commands/server_test.go index a8dfc92477..8d94a4de17 100644 --- a/cmd/mattermost/commands/server_test.go +++ b/cmd/mattermost/commands/server_test.go @@ -17,7 +17,7 @@ import ( ) const ( - UnitTestListeningPort = ":0" + unitTestListeningPort = ":0" ) //nolint:golint,unused @@ -64,7 +64,9 @@ func TestRunServerSuccess(t *testing.T) { configStore := config.NewTestMemoryStore() // Use non-default listening port in case another server instance is already running. - *configStore.Get().ServiceSettings.ListenAddress = UnitTestListeningPort + cfg := configStore.Get() + *cfg.ServiceSettings.ListenAddress = unitTestListeningPort + configStore.Set(cfg) err := runServer(configStore, th.interruptChan) require.NoError(t, err) @@ -114,7 +116,9 @@ func TestRunServerSystemdNotification(t *testing.T) { configStore := config.NewTestMemoryStore() // Use non-default listening port in case another server instance is already running. - *configStore.Get().ServiceSettings.ListenAddress = UnitTestListeningPort + cfg := configStore.Get() + *cfg.ServiceSettings.ListenAddress = unitTestListeningPort + configStore.Set(cfg) // Start and stop the server err = runServer(configStore, th.interruptChan) @@ -137,7 +141,9 @@ func TestRunServerNoSystemd(t *testing.T) { configStore := config.NewTestMemoryStore() // Use non-default listening port in case another server instance is already running. - *configStore.Get().ServiceSettings.ListenAddress = UnitTestListeningPort + cfg := configStore.Get() + *cfg.ServiceSettings.ListenAddress = unitTestListeningPort + configStore.Set(cfg) err := runServer(configStore, th.interruptChan) require.NoError(t, err)