From a3f132e3d5a70e2bbfeac7090098732292b57447 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 19:33:32 +0000 Subject: [PATCH] Adding upgrade test for unhealthy upgraded Agent (#3274) (#3387) * [WIP] Adding upgrade test for unhealthy upgraded Agent * Fixing up logging * WIP: fixing some issues with fake package creation * Use fast watcher config * [WIP] Different approach to making upgraded Agent unhealthy * WIP: Adding TODO * Flesh out rest of the test * Adding logging * Make invalid input try to run in upgraded Agent version * Removing OS restriction * Tuning status check frequency * Use artifacts API * Clarify comment (cherry picked from commit 5531ad31f3a244ea579ba00439b785b3eb39f139) Co-authored-by: Shaunak Kashyap --- pkg/testing/fixture_install.go | 2 ++ testing/integration/upgrade_test.go | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/testing/fixture_install.go b/pkg/testing/fixture_install.go index 81ca7025e3a..469ffdde74f 100644 --- a/pkg/testing/fixture_install.go +++ b/pkg/testing/fixture_install.go @@ -87,6 +87,7 @@ func (i InstallOpts) toCmdArgs() []string { // - the combined output of stdout and stderr // - an error if any. func (f *Fixture) Install(ctx context.Context, installOpts *InstallOpts, opts ...process.CmdOption) ([]byte, error) { + f.t.Logf("[test %s] Inside fixture install function", f.t.Name()) installArgs := []string{"install"} if installOpts != nil { installArgs = append(installArgs, installOpts.toCmdArgs()...) @@ -110,6 +111,7 @@ func (f *Fixture) Install(ctx context.Context, installOpts *InstallOpts, opts .. f.setClient(c) f.t.Cleanup(func() { + f.t.Logf("[test %s] Inside fixture cleanup function", f.t.Name()) if !f.installed { f.t.Logf("skipping uninstall; agent not installed (fixture.installed is false)") // not installed; no need to clean up or collect diagnostics diff --git a/testing/integration/upgrade_test.go b/testing/integration/upgrade_test.go index df3d4094129..4f0c6300912 100644 --- a/testing/integration/upgrade_test.go +++ b/testing/integration/upgrade_test.go @@ -1003,8 +1003,6 @@ func TestStandaloneUpgradeFailsStatus(t *testing.T) { Sudo: true, // requires Agent installation }) - t.Skip("Affected by https://github.com/elastic/elastic-agent/issues/3371, watcher left running at end of test") - upgradeFromVersion, err := version.ParseVersion(define.Version()) require.NoError(t, err)