aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-11-21 23:14:32 +0900
committerOphestra <cat@gensokyo.uk>2026-11-21 23:14:32 +0900
commitee51069e4756492f445069e39cc13715c6b19f0d (patch)
tree7e91f3bd14f4d58799a34a5fac1d6dd174aec308
parent8871bad4d46c73594ae9f3e8c4cc29bd0b87fbff (diff)
internal/testsuite: poll output after notify
This makes debugging a bad poll much easier. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/testsuite/testsuite.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/testsuite/testsuite.go b/internal/testsuite/testsuite.go
index 5eb0e1d4..a0ae4999 100644
--- a/internal/testsuite/testsuite.go
+++ b/internal/testsuite/testsuite.go
@@ -316,11 +316,13 @@ func Poll(
extraEnv []string,
command ...string,
) {
+ var output bool
n := time.NewTicker(1 * time.Second)
defer n.Stop()
go func() {
for range n.C {
log.Printf("still polling %s", strings.Join(command, " "))
+ output = true
}
}()
@@ -331,6 +333,10 @@ func Poll(
Credential: cred,
}
MustAppendEnv(cmd, extraEnv...)
+ if output {
+ cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
+ output = false
+ }
if err := cmd.Run(); err != nil {
if e, ok := errors.AsType[*exec.ExitError](err); ok && e.Exited() {
continue