From 411d360cb08c5e1030fc9c5ed3cbe6a8888cbd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Julia=CC=81n?= Date: Thu, 30 Jan 2025 14:42:21 +0100 Subject: [PATCH] Check error is not nil --- test/new-e2e/pkg/environments/host.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/new-e2e/pkg/environments/host.go b/test/new-e2e/pkg/environments/host.go index fd07d96f960fa2..96390a67b28359 100644 --- a/test/new-e2e/pkg/environments/host.go +++ b/test/new-e2e/pkg/environments/host.go @@ -65,7 +65,9 @@ func (e *Host) generateAndDownloadAgentFlare(outputDir string) (string, error) { flareCommandOutput, err := e.Agent.Client.FlareWithError(agentclient.WithArgs([]string{"--email", "e2e-tests@datadog-agent", "--send", "--local"})) // on error, the flare output is in the error message - flareCommandOutput = strings.Join([]string{flareCommandOutput, err.Error()}, "\n") + if err != nil { + flareCommandOutput = strings.Join([]string{flareCommandOutput, err.Error()}, "\n") + } // find .zip in flare command output // (?m) is a flag that allows ^ and $ to match the beginning and end of each line