[API] Add propagation fuzz tests and fix findings#7061
[API] Add propagation fuzz tests and fix findings#7061martincostello merged 14 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7061 +/- ##
==========================================
+ Coverage 88.29% 88.51% +0.22%
==========================================
Files 270 270
Lines 12759 12884 +125
==========================================
+ Hits 11265 11404 +139
+ Misses 1494 1480 -14
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Pull request overview
Adds a new OpenTelemetry.Api.FuzzTests test project to exercise propagation-related APIs with FsCheck-based property tests, aiming to harden string parsing and ensure stable behavior across a wide range of generated inputs.
Changes:
- Introduce a new fuzz test project (
OpenTelemetry.Api.FuzzTests) targeting the repo’s test TFMs and usingFsCheck.Xunit. - Add property-based fuzz tests for
TraceContextPropagator,BaggagePropagator, andB3Propagator, plus shared generators/helpers. - Include the new fuzz test project in
OpenTelemetry.slnx.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/OpenTelemetry.Api.FuzzTests/OpenTelemetry.Api.FuzzTests.csproj | New fuzz test project definition with FsCheck and OpenTelemetry.Api reference. |
| test/OpenTelemetry.Api.FuzzTests/Context/Propagation/TraceContextPropagatorFuzzTests.cs | Adds property tests for trace context inject/extract round-trips and determinism. |
| test/OpenTelemetry.Api.FuzzTests/Context/Propagation/BaggagePropagatorFuzzTests.cs | Adds property tests for baggage round-trips, size limits, and determinism. |
| test/OpenTelemetry.Api.FuzzTests/Context/Propagation/B3PropagatorFuzzTests.cs | Adds property tests for obsolete B3 propagator (single/multi header) round-trips and determinism. |
| test/OpenTelemetry.Api.FuzzTests/Context/Propagation/Generators.cs | Provides FsCheck generators for contexts and arbitrary header carriers. |
| test/OpenTelemetry.Api.FuzzTests/Context/Propagation/FuzzTestHelpers.cs | Shared getter/setter delegates, carrier cloning/comparison, and allowed-exception filter. |
| OpenTelemetry.slnx | Adds the new fuzz test project to the solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add fuzz tests for the propagator classes.
Fix baggage length being exceeded.
Add more tests around exceeding the maximum length.
Add entry for bug fix.
Add missing access modifier.
Reduce allocations when parsing propagation headers.
- Improve baggage, B3 and Jaeger header parsing. - Add fuzz tests for the OpenTelemetry.Extensions.Propagators library. - Update CHANGELOGs.
Apply manual refactoring to Copilot edits to improve readability, add more tests and use `SearchValues<T>` where available.
- Avoid LINQ. - Use spans where possible.
Add fuzzing for previous commit.
324eb7b to
663c1c4
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Fix trace propagation not always enforcing limits.
Add benchmarks for `B3Propagator` and `JaegerPropagator` to use to compute impact of changes.
Add missing test coverage for B3 and Jaeger.
Changes
Add fuzz tests for the propagator classes.
I thought it would be a good idea to add these after working on #7059 and #7060 due to the amount of string parsing they do.
In the process of adding the new fuzz tests, some bugs were found in the processing that have now been fixed.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)