diff --git a/otelcol/collector_test.go b/otelcol/collector_test.go index 6a7bd1f78b3..7f42b3d71a4 100644 --- a/otelcol/collector_test.go +++ b/otelcol/collector_test.go @@ -525,7 +525,7 @@ func TestCollectorConfmapLogs(t *testing.T) { require.NotNil(t, col.ol) require.Greater(t, col.ol.Len(), 0) - messages := make([]string, 0) + messages := make([]string, 0, col.ol.Len()) for _, l := range col.ol.All() { messages = append(messages, l.Message) }