Skip to content

[TEST] Multiple exports in OTLP HTTP exporters tests#3771

Merged
marcalff merged 3 commits intoopen-telemetry:mainfrom
owent:allow_exporting_twice_fot_http_exporters
Dec 3, 2025
Merged

[TEST] Multiple exports in OTLP HTTP exporters tests#3771
marcalff merged 3 commits intoopen-telemetry:mainfrom
owent:allow_exporting_twice_fot_http_exporters

Conversation

@owent
Copy link
Copy Markdown
Member

@owent owent commented Nov 29, 2025

Fixes #3721

Changes

  • Allow retryable exports or split them into two batch jobs for OTLP HTTP exporters.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

Copilot AI review requested due to automatic review settings November 29, 2025 04:32
@owent owent requested a review from a team as a code owner November 29, 2025 04:32
Copy link
Copy Markdown

Copilot AI left a 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

Comment thread exporters/otlp/test/otlp_http_metric_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_metric_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_log_record_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_metric_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_log_record_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_metric_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_log_record_exporter_test.cc Outdated
Comment thread exporters/otlp/test/otlp_http_exporter_test.cc Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.93%. Comparing base (69e62f7) to head (dde5719).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3771   +/-   ##
=======================================
  Coverage   89.93%   89.93%           
=======================================
  Files         225      225           
  Lines        7165     7165           
=======================================
  Hits         6443     6443           
  Misses        722      722           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix.

@marcalff marcalff changed the title Allow exporting multiple times for unit tests of OTLP HTTP exporters [TEST] Multiple exports in OTLP HTTP exporters tests Dec 3, 2025
@marcalff marcalff merged commit 1e8de02 into open-telemetry:main Dec 3, 2025
67 checks passed
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 this pull request may close these issues.

[TEST] Test failure in OtlpHttpExporterTestPeer.ExportJsonIntegrationTestSync

3 participants