-
Notifications
You must be signed in to change notification settings - Fork 511
Allow exporting multiple times for unit tests of OTLP HTTP exporters #3771
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
base: main
Are you sure you want to change the base?
Allow exporting multiple times for unit tests of OTLP HTTP exporters #3771
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modifies OTLP HTTP exporter tests to support multiple export attempts in unit tests, addressing issue #3721. The changes enable tests to handle retryable exports or split batch jobs.
Key Changes
- Changed mock expectations from
.WillOnce()to.WillRepeatedly()to allow multiple export invocations - Added early-return guards to handle empty payloads gracefully
- Introduced counter validation to ensure at least one successful export occurred
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| exporters/otlp/test/otlp_http_metric_exporter_test.cc | Updated 6 test methods to support retryable metric exports with counter validation |
| exporters/otlp/test/otlp_http_log_record_exporter_test.cc | Updated 4 test methods to support retryable log exports with counter validation |
| exporters/otlp/test/otlp_http_exporter_test.cc | Updated 4 test methods to support retryable trace exports with counter validation |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3771 +/- ##
==========================================
+ Coverage 89.93% 89.95% +0.02%
==========================================
Files 225 225
Lines 7158 7158
==========================================
+ Hits 6437 6438 +1
+ Misses 721 720 -1 🚀 New features to boost your workflow:
|
Fixes #3721
Changes
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes