From aff7525af2da8c894930bddd6e5771a66d230d65 Mon Sep 17 00:00:00 2001 From: Ankit Patel <8731662+ankitpatel96@users.noreply.github.com> Date: Thu, 9 May 2024 16:38:16 -0400 Subject: [PATCH] MemoryLimiterProcessor - switch to MustNewID instead of zero value ID (#10128) #### Description In an upcoming PR, I change Type to be an interface. This means the zero value of Type will be nil - which will cause this test to fail. Initializing ID instead of relying on the zero value fixes this #### Link to tracking issue related to https://github.com/open-telemetry/opentelemetry-collector/issues/9429 In preparation for https://github.com/open-telemetry/opentelemetry-collector/pull/10069 --- processor/memorylimiterprocessor/memorylimiter_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/processor/memorylimiterprocessor/memorylimiter_test.go b/processor/memorylimiterprocessor/memorylimiter_test.go index 10bc8d7911c..0c103157346 100644 --- a/processor/memorylimiterprocessor/memorylimiter_test.go +++ b/processor/memorylimiterprocessor/memorylimiter_test.go @@ -56,7 +56,9 @@ func TestNoDataLoss(t *testing.T) { limiter, err := newMemoryLimiterProcessor(set, cfg) require.NoError(t, err) - processor, err := processorhelper.NewLogsProcessor(context.Background(), processor.CreateSettings{}, cfg, exporter, + processor, err := processorhelper.NewLogsProcessor(context.Background(), processor.CreateSettings{ + ID: component.MustNewID("nop"), + }, cfg, exporter, limiter.processLogs, processorhelper.WithStart(limiter.start), processorhelper.WithShutdown(limiter.shutdown))