Skip to content

Commit

Permalink
#4538: added core container log output on integrationt test wait loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Aug 20, 2024
1 parent f91fa55 commit d049e73
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions services/horizon/internal/test/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ const coreStartupPingInterval = time.Second

// Wait for core to be up and manually close the first ledger
func (i *Test) waitForCore() {
integrationYaml := filepath.Join(i.composePath, "docker-compose.integration-tests.yml")
i.t.Log("Waiting for core to be up...")
startTime := time.Now()
for time.Since(startTime) < maxWaitForCoreStartup {
Expand All @@ -566,6 +567,13 @@ func (i *Test) waitForCore() {
if durationSince := time.Since(infoTime); durationSince < coreStartupPingInterval {
time.Sleep(coreStartupPingInterval - durationSince)
}
cmdline := []string{"-f", integrationYaml, "logs", "core"}
cmdline = append([]string{"compose"}, cmdline...)
cmd := exec.Command("docker", cmdline...)
out, _ := cmd.Output()
if len(out) > 0 {
fmt.Printf("core container logs:\n%s\n", string(out))
}
continue
}
break
Expand Down

0 comments on commit d049e73

Please sign in to comment.