From 0e3b9aa5e50f4494121c734d3fdc0b8f22a7f5af Mon Sep 17 00:00:00 2001 From: "Lee E. Hinman" Date: Thu, 2 Jan 2025 13:28:44 -0600 Subject: [PATCH] implement suggested changes --- dev-tools/packaging/package_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev-tools/packaging/package_test.go b/dev-tools/packaging/package_test.go index dc584f736755..6a9a72a8facd 100644 --- a/dev-tools/packaging/package_test.go +++ b/dev-tools/packaging/package_test.go @@ -600,23 +600,23 @@ func checkDockerImageRun(t *testing.T, p *packageFile, imagePath string) { for { select { case <-timer.C: - t.Fatalf("logs:\n%s\nnever saw %q within timeout", string(logs), sentinelLog) - goto done + t.Fatalf("never saw %q within timeout\nlogs:\n%s", sentinelLog, string(logs)) + return case <-ticker.C: out, err := c.ContainerLogs(ctx, createResp.ID, container.LogsOptions{ShowStdout: true, ShowStderr: true}) if err != nil { t.Logf("could not get logs: %s", err) } logs, err = io.ReadAll(out) + out.Close() if err != nil { t.Logf("error reading logs: %s", err) } if bytes.Contains(logs, []byte(sentinelLog)) { - goto done + return } } } - done: }) }