Skip to content

Commit

Permalink
Avoid SEGFAULT when cleaning up installation in integration tests fix…
Browse files Browse the repository at this point in the history
…ture (#2741)
  • Loading branch information
pchila authored May 29, 2023
1 parent ab82582 commit 953fda0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/testing/fixture_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ func (i InstallOpts) toCmdArgs() []string {
// Install installs the prepared Elastic Agent binary
func (f *Fixture) Install(ctx context.Context, installOpts *InstallOpts, opts ...process.CmdOption) ([]byte, error) {
installArgs := []string{"install"}
installArgs = append(installArgs, installOpts.toCmdArgs()...)
if installOpts != nil {
installArgs = append(installArgs, installOpts.toCmdArgs()...)
}
out, err := f.Exec(ctx, installArgs, opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -111,7 +113,9 @@ func (f *Fixture) Uninstall(ctx context.Context, uninstallOpts *UninstallOpts, o
}

uninstallArgs := []string{"uninstall"}
uninstallArgs = append(uninstallArgs, uninstallOpts.toCmdArgs()...)
if uninstallOpts != nil {
uninstallArgs = append(uninstallArgs, uninstallOpts.toCmdArgs()...)
}
out, err := f.Exec(ctx, uninstallArgs, opts...)
if err != nil {
return nil, err
Expand Down

0 comments on commit 953fda0

Please sign in to comment.