* bind to localhost:0 for tests

Explicitly bind to `localhost:0` instead of just `:0` to avoid binding to all available interfaces and in turn avoid triggering firewall warnings on MacOS.

* fix Playbooks to use dynamic port

* TestMetrics: handle ipv4 localhost too

* TestMetrics: linting
Этот коммит содержится в:
Jesse Hallam
2023-04-06 09:59:58 -03:00
коммит произвёл GitHub
родитель 7325c38c39
Коммит 4b7f6cb974
10 изменённых файлов: 21 добавлений и 19 удалений

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

@@ -107,7 +107,7 @@ func setupTestHelper(tb testing.TB, includeCacheLayer bool) *TestHelper {
a := app.New(app.ServerConnector(s.Channels()))
prevListenAddress := *s.Config().ServiceSettings.ListenAddress
a.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.ListenAddress = ":0" })
a.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.ListenAddress = "localhost:0" })
serverErr := s.Start()
if serverErr != nil {
panic(serverErr)