MM-42880: Fix TestRunServerSuccess (#19910)

https://mattermost.atlassian.net/browse/MM-42880

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-04-07 20:13:27 +05:30
коммит произвёл GitHub
родитель 302736d4a3
Коммит b6f18d3bb0

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

@@ -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)