Skip to content

Commit

Permalink
fix: update go.mod and test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
VihasMakwana committed Jul 24, 2024
1 parent 907cfa7 commit d6ca537
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/elastic/elastic-agent-autodiscover v0.8.0
github.com/elastic/elastic-agent-client/v7 v7.15.0
github.com/elastic/elastic-agent-libs v0.9.15
github.com/elastic/elastic-agent-system-metrics v0.10.4
github.com/elastic/elastic-agent-system-metrics v0.10.6-0.20240723152150-0f81a1e67528
github.com/elastic/elastic-transport-go/v8 v8.6.0
github.com/elastic/go-elasticsearch/v8 v8.14.0
github.com/elastic/go-licenser v0.4.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ github.com/elastic/elastic-agent-libs v0.9.15 h1:WCLtuErafUxczT/rXJa4Vr6mxwC8dgt
github.com/elastic/elastic-agent-libs v0.9.15/go.mod h1:2VgYxHaeM+cCDBjiS2wbmTvzPGbnlXAtYrlcLefheS8=
github.com/elastic/elastic-agent-system-metrics v0.10.4 h1:Tmb1rPRDyVv9M453YlPyl/gwUm9s4nSiI2xH76GGEz4=
github.com/elastic/elastic-agent-system-metrics v0.10.4/go.mod h1:cd7YgcTEjBNeLGnH/C9cEvP/YexohwS6CpmN9Ju58Mw=
github.com/elastic/elastic-agent-system-metrics v0.10.6-0.20240723152150-0f81a1e67528 h1:AuBoMilTnJRszbtwZQSTbzuA81TgWz+unsqRR0Brs14=
github.com/elastic/elastic-agent-system-metrics v0.10.6-0.20240723152150-0f81a1e67528/go.mod h1:cd7YgcTEjBNeLGnH/C9cEvP/YexohwS6CpmN9Ju58Mw=
github.com/elastic/elastic-transport-go/v8 v8.6.0 h1:Y2S/FBjx1LlCv5m6pWAF2kDJAHoSjSRSJCApolgfthA=
github.com/elastic/elastic-transport-go/v8 v8.6.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
github.com/elastic/go-docappender/v2 v2.2.0 h1:Pq6w+R0ZbWlqZHoqzoujR2ElKBfaPUf3M/cJvPVSrfA=
Expand Down
2 changes: 1 addition & 1 deletion pkg/testing/fixture_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func getProcesses(t *gotesting.T, regex string) []runningProcess {
}

_, pids, err := procStats.FetchPids()
if !assert.NoError(t, err, "error fetching process information") {
if !errors.Is(err, agentsystemprocess.NonFatalErr{}) && !assert.NoError(t, err, "error fetching process information") {
// we failed a bit further
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/utils/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package utils

import (
"errors"
"fmt"
"path/filepath"
"strings"
Expand All @@ -24,7 +25,8 @@ func GetWatcherPIDs() ([]int, error) {
return nil, fmt.Errorf("failed to initialize process.Stats: %w", err)
}
pidMap, _, err := procStats.FetchPids()
if err != nil {
if err != nil && !errors.Is(err, process.NonFatalErr{}) {
// return only if the error is fatal in nature
return nil, fmt.Errorf("failed to fetch pids: %w", err)
}
var pids []int
Expand Down

0 comments on commit d6ca537

Please sign in to comment.