Skip to content

Commit bde9684

Browse files
authored
Fix fixture diagnostics unconditionally logging an error. (#4448)
1 parent 08bd15e commit bde9684

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/testing/fixture_install.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,9 @@ func (f *Fixture) collectDiagnostics() {
553553
f.t.Logf("retrying in 15 seconds due to connection error; possible Elastic Agent was not fully started")
554554
time.Sleep(15 * time.Second)
555555
output, err = f.Exec(ctx, []string{"diagnostics", "-f", outputPath})
556-
f.t.Logf("failed to collect diagnostics a second time at %s (%s): %s", outputPath, err, output)
556+
if err != nil {
557+
f.t.Logf("failed to collect diagnostics a second time at %s (%s): %s", outputPath, err, output)
558+
}
557559
}
558560
if err != nil {
559561
// If collecting diagnostics fails, zip up the entire installation directory with the hope that it will contain logs.

0 commit comments

Comments
 (0)