diff --git a/test/new-e2e/pkg/environments/host.go b/test/new-e2e/pkg/environments/host.go index fd07d96f960fa..96390a67b2835 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