Skip to content

Commit

Permalink
[Ingest Manager] Fix failing unit tests on windows (elastic#20127)
Browse files Browse the repository at this point in the history
* remove skip

* close properly

* changelog

* space
  • Loading branch information
michalpristas committed Jul 23, 2020
1 parent ab41986 commit 24741fe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
- Remove support for logs type and use logfile {pull}19761[19761]
- Avoid comparing uncomparable types on enroll {issue}19976[19976]
- Fix issues with merging of elastic-agent.yml and fleet.yml {pull}20026[20026]
- Fix failing unit tests on windows {pull}20127[20127]

==== New features

Expand Down
1 change: 1 addition & 0 deletions x-pack/elastic-agent/pkg/agent/application/action_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func newActionStore(log *logger.Logger, store storeLoad) (*actionStore, error) {
if err != nil {
return &actionStore{log: log, store: store}, nil
}
defer reader.Close()

var action actionConfigChangeSerializer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"runtime"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -20,10 +19,6 @@ import (
)

func TestActionStore(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping on windows see https://github.com/elastic/beats/issues/19919")
}

log, _ := logger.New("action_store")
withFile := func(fn func(t *testing.T, file string)) func(*testing.T) {
return func(t *testing.T) {
Expand Down
4 changes: 4 additions & 0 deletions x-pack/elastic-agent/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func NewConfigFrom(from interface{}) (*Config, error) {
}

if in, ok := from.(io.Reader); ok {
if closer, ok := from.(io.Closer); ok {
defer closer.Close()
}

content, err := ioutil.ReadAll(in)
if err != nil {
return nil, err
Expand Down

0 comments on commit 24741fe

Please sign in to comment.