Skip to content

Commit

Permalink
Adding upgrade test for unhealthy upgraded Agent (#3274) (#3387)
Browse files Browse the repository at this point in the history
* [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 5531ad3)

Co-authored-by: Shaunak Kashyap <[email protected]>
  • Loading branch information
mergify[bot] and ycombinator authored Oct 2, 2023
1 parent d1a0420 commit a3f132e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/testing/fixture_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()...)
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions testing/integration/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a3f132e

Please sign in to comment.