Skip to content

Commit

Permalink
Print more logs
Browse files Browse the repository at this point in the history
Signed-off-by: joeyyy09 <[email protected]>
  • Loading branch information
joeyyy09 committed Jul 28, 2024
1 parent b4582d0 commit 2f92867
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/jaeger/internal/integration/e2e_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,26 @@ func (s *E2EStorageIntegration) e2eInitialize(t *testing.T, storage string) {
Stdout: outFile,
Stderr: errFile,
}
t.Logf("Running command: %v", cmd.Args)
require.NoError(t, cmd.Start())
require.Eventually(t, func() bool {
url := fmt.Sprintf("http://localhost:%d/", ports.QueryHTTP)
t.Logf("Checking if Jaeger-v2 is available on %s", url)
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
require.NoError(t, err)
if err != nil {
t.Logf("HTTP request creation failed: %v", err)
return false
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
t.Log(err)
t.Logf("HTTP request failed: %v", err)
return false
}
defer resp.Body.Close()
return resp.StatusCode == http.StatusOK
}, 30*time.Second, 500*time.Millisecond, "Jaeger-v2 did not start")
}, 60*time.Second, 1*time.Millisecond, "Jaeger-v2 did not start")
t.Log("Jaeger-v2 is ready")
t.Cleanup(func() {
if err := cmd.Process.Kill(); err != nil {
Expand Down

0 comments on commit 2f92867

Please sign in to comment.