Skip to content

Test OTLP retry cancellation causes - #8724

Merged
dashpole merged 5 commits into
open-telemetry:mainfrom
MrAlias:agent/test-otlp-retry-cancel-cause
Aug 18, 2026
Merged

dashpole merged 5 commits into
open-telemetry:mainfrom
MrAlias:agent/test-otlp-retry-cancel-cause

Conversation

@MrAlias

@MrAlias MrAlias commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • cover custom context cancellation causes in the shared OTLP retry TestWait table
  • regenerate the retry tests for the gRPC and HTTP log, metric, and trace exporters

This follows up on review feedback from #7811. The existing test covered the default context.Canceled result but did not exercise a caller-supplied cancellation cause. The new case pins that behavior across every generated retry package.

This is test-only and does not change runtime behavior.

Testing

  • make precommit

Add a TestWait case that cancels a context with a custom cause and
asserts the retry wait returns that cause. Regenerate all OTLP exporter
copies so the behavior is covered consistently.

This follows up on review feedback from open-telemetry#7811, which changed retry
cancellation handling to preserve context causes.
@codecov

codecov Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

โœ… All modified and coverable lines are covered by tests.
โœ… Project coverage is 84.1%. Comparing base (a4f3c4d) to head (c7d64bd).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8724   +/-   ##
=====================================
  Coverage   84.1%   84.1%           
=====================================
  Files        331     331           
  Lines      26487   26487           
=====================================
+ Hits       22286   22296   +10     
+ Misses      3795    3786    -9     
+ Partials     406     405    -1     

see 2 files with indirect coverage changes

๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrAlias MrAlias added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Aug 10, 2026
@MrAlias
MrAlias marked this pull request as ready for review August 10, 2026 20:26

@ps-mir ps-mir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thoughts on test for RequestFunc ?

Exercise both default and custom cancellation causes through the retry
request wrapper. This proves the wrapper preserves the caller-provided
cause alongside the request error without making an extra request.

Regenerate all OTLP retry test copies from the shared template.

MrAlias commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@ps-mir Added RequestFunc coverage in TestBackoffRetryCanceledContext for both the default and a custom cancellation cause. Each case asserts the returned error wraps both the cancellation cause and the request error, and that the request executes exactly once. The shared template regenerates this coverage across all six OTLP exporters. make precommit passes.

@dashpole
dashpole merged commit 0de413a into open-telemetry:main Aug 18, 2026
49 checks passed
@MrAlias
MrAlias deleted the agent/test-otlp-retry-cancel-cause branch August 18, 2026 14:35
@pellared pellared added this to the v1.46.0 milestone Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants