diff --git a/processor/batchprocessor/factory_test.go b/processor/batchprocessor/factory_test.go index 2550dd5f534..c3d4950f3d1 100644 --- a/processor/batchprocessor/factory_test.go +++ b/processor/batchprocessor/factory_test.go @@ -29,7 +29,7 @@ func TestCreateProcessor(t *testing.T) { tp, err := factory.CreateTracesProcessor(context.Background(), creationSet, cfg, nil) assert.NotNil(t, tp) assert.NoError(t, err, "cannot create trace processor") - defer func() { assert.NoError(t, tp.Shutdown(context.Background())) }() + assert.NoError(t, tp.Shutdown(context.Background())) mp, err := factory.CreateMetricsProcessor(context.Background(), creationSet, cfg, nil) assert.NotNil(t, mp)