Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lifecycle tests: batch processor fix failing test #9688

Closed
codeboten opened this issue Mar 4, 2024 · 0 comments · Fixed by #9768
Closed

lifecycle tests: batch processor fix failing test #9688

codeboten opened this issue Mar 4, 2024 · 0 comments · Fixed by #9768

Comments

@codeboten
Copy link
Contributor

codeboten commented Mar 4, 2024

Related to #9683 (review)

dmitryax pushed a commit that referenced this issue Mar 15, 2024
**Description:** 
fix #9688

The batchprocessor use a `batchProcessor` as a common struct which
implements `consumer.Traces`, `consumer.Metrics`, `consumer.Logs` in the
meantime.

As a result, the generated lifecycle test will fail, since when it
create a metrics, traces processor object, it will still fall to the
case `consumer.Logs` and panic.
```
=== RUN   TestComponentLifecycle/metrics-shutdown
=== RUN   TestComponentLifecycle/metrics-lifecycle
panic: interface conversion: interface {} is plog.Logs, not pmetric.Metrics

goroutine 37 [running]:
go.opentelemetry.io/collector/processor/batchprocessor.(*batchMetrics).add(0x14000208120?, {0x10572aae0?, 0x1400029c3f0?})
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:450 +0x208
go.opentelemetry.io/collector/processor/batchprocessor.(*shard).processItem(0x14000292200, {0x10572aae0?, 0x1400029c3f0?})
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:226 +0x38
go.opentelemetry.io/collector/processor/batchprocessor.(*shard).start(0x14000292200)
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:199 +0x1a0
created by go.opentelemetry.io/collector/processor/batchprocessor.(*batchProcessor).newShard in goroutine 36
	/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:160 +0x1a4
exit status 2
FAIL	go.opentelemetry.io/collector/processor/batchprocessor	0.594s
```

**Link to tracking Issue:** <Issue number if applicable>
fix #9688

---------

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant