Skip to content

Commit 34f3c91

Browse files
authored
Use logp.NewNopLogger for TestGenerateProcessorList (#47316)
Because logptest.NewTestingLogger uses the testing.T as the output for the logger, it could happen that the processors would log after the test had ended, leading to a panic. This commit fixes it by using a no-op logger instead.
1 parent 6f2416f commit 34f3c91

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libbeat/publisher/processing/default_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"github.com/elastic/beats/v7/libbeat/processors/actions/addfields"
3333
"github.com/elastic/elastic-agent-libs/config"
3434
"github.com/elastic/elastic-agent-libs/logp"
35-
"github.com/elastic/elastic-agent-libs/logp/logptest"
3635
"github.com/elastic/elastic-agent-libs/mapstr"
3736

3837
_ "github.com/elastic/beats/v7/libbeat/processors/add_cloud_metadata"
@@ -52,7 +51,7 @@ func TestGenerateProcessorList(t *testing.T) {
5251
plugins, err := processors.NewPluginConfigFromList(inputCfg)
5352
require.NoError(t, err)
5453

55-
processors, err := processors.New(plugins, logptest.NewTestingLogger(t, ""))
54+
processors, err := processors.New(plugins, logp.NewNopLogger())
5655
require.NoError(t, err)
5756
// make sure the processor init got the config formatted in a way it expected
5857
require.Equal(t, 4, len(processors.List))

0 commit comments

Comments
 (0)