diff --git a/metricbeat/module/system/process/process_test.go b/metricbeat/module/system/process/process_test.go index 737b8d615f6..78946913907 100644 --- a/metricbeat/module/system/process/process_test.go +++ b/metricbeat/module/system/process/process_test.go @@ -20,6 +20,7 @@ package process import ( + "errors" "os" "testing" "time" @@ -38,7 +39,7 @@ func TestFetch(t *testing.T) { f := mbtest.NewReportingMetricSetV2Error(t, getConfig()) events, errs := mbtest.ReportingFetchV2Error(f) for _, err := range errs { - assert.True(t, process.CanDegrade(err)) + assert.True(t, errors.Is(err, process.NonFatalErr{})) } assert.NotEmpty(t, events) @@ -46,7 +47,7 @@ func TestFetch(t *testing.T) { events, errs = mbtest.ReportingFetchV2Error(f) for _, err := range errs { - assert.True(t, process.CanDegrade(err)) + assert.True(t, errors.Is(err, process.NonFatalErr{})) } assert.NotEmpty(t, events) diff --git a/metricbeat/module/system/process_summary/process_summary_test.go b/metricbeat/module/system/process_summary/process_summary_test.go index a0083c03dc6..1349fd83b47 100644 --- a/metricbeat/module/system/process_summary/process_summary_test.go +++ b/metricbeat/module/system/process_summary/process_summary_test.go @@ -20,6 +20,7 @@ package process_summary import ( + "errors" "testing" "github.com/stretchr/testify/assert" @@ -47,7 +48,7 @@ func TestFetch(t *testing.T) { events, errs := mbtest.ReportingFetchV2Error(f) for _, err := range errs { - assert.True(t, process.CanDegrade(err)) + assert.True(t, errors.Is(err, process.NonFatalErr{})) } require.NotEmpty(t, events) event := events[0].BeatEvent("system", "process_summary").Fields @@ -65,7 +66,7 @@ func TestStateNames(t *testing.T) { events, errs := mbtest.ReportingFetchV2Error(f) for _, err := range errs { - assert.True(t, process.CanDegrade(err)) + assert.True(t, errors.Is(err, process.NonFatalErr{})) } require.NotEmpty(t, events) event := events[0].BeatEvent("system", "process_summary").Fields