From d049e7387df2b5a45d95fc8f425b2b6e41f9bbac Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Tue, 20 Aug 2024 15:55:35 -0700 Subject: [PATCH] #4538: added core container log output on integrationt test wait loop --- services/horizon/internal/test/integration/integration.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/horizon/internal/test/integration/integration.go b/services/horizon/internal/test/integration/integration.go index 107cb33759..65c45a3068 100644 --- a/services/horizon/internal/test/integration/integration.go +++ b/services/horizon/internal/test/integration/integration.go @@ -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 { @@ -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