Skip to content

Commit

Permalink
MemoryLimiterProcessor - switch to MustNewID instead of zero value ID (
Browse files Browse the repository at this point in the history
…#10128)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### 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

<!-- Issue number if applicable -->
#### Link to tracking issue
related to
#9429


<!--Please delete paragraphs that you did not use before submitting.-->
In preparation for
#10069
  • Loading branch information
ankitpatel96 committed May 9, 2024
1 parent bfe3b31 commit c8f9563
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion processor/memorylimiterprocessor/memorylimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c8f9563

Please sign in to comment.