Chore: Add AwaitHealthy to ModuleEngine and Server (#72215)

* Chore: Add AwaitHealthy to ModuleEngine and Server

* switch from fmt.Errorf to errors.New

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
Todd Treece
2023-07-24 14:01:07 -04:00
committed by GitHub
parent c7eb7fb58a
commit 4b95f611c2
4 changed files with 27 additions and 3 deletions

View File

@@ -71,6 +71,8 @@ func StartGrafanaEnv(t *testing.T, grafDir, cfgPath string) (string, *server.Tes
})
// Wait for Grafana to be ready
err = env.Server.AwaitHealthy(ctx)
require.NoError(t, err)
addr := listener.Addr().String()
resp, err := http.Get(fmt.Sprintf("http://%s/api/health", addr))
require.NoError(t, err)