diff --git a/pkg/testing/fixture_install.go b/pkg/testing/fixture_install.go index 14a4e265288..e424c1785e4 100644 --- a/pkg/testing/fixture_install.go +++ b/pkg/testing/fixture_install.go @@ -128,6 +128,7 @@ func (f *Fixture) Install(ctx context.Context, installOpts *InstallOpts, opts .. // environment variable AGENT_KEEP_INSTALLED=true will skip the uninstall // useful to debug the issue with the Elastic Agent +<<<<<<< HEAD if keepInstalled() { f.t.Logf("skipping uninstall; AGENT_KEEP_INSTALLED=true") } else { @@ -144,6 +145,16 @@ func (f *Fixture) Install(ctx context.Context, installOpts *InstallOpts, opts .. return } require.NoErrorf(f.t, err, "uninstalling agent failed. Output: %q", out) +======= + if f.t.Failed() && keepInstalled() { + f.t.Logf("skipping uninstall; test failed and AGENT_KEEP_INSTALLED=true") + return + } + + if keepInstalled() { + f.t.Logf("ignoring AGENT_KEEP_INSTALLED=true as test succeeded, " + + "keeping the agent installed will jeopardise other tests") +>>>>>>> 3372e6f8f1 (fix when fixture.Install logs 'ignoring AGENT_KEEP_INSTALLED...' (#3380)) } })