Skip to content

Improve aggregation concurrent safe tests#8021

Merged
dashpole merged 8 commits intoopen-telemetry:mainfrom
dashpole:exphist_concurrentsafe_tests
Mar 13, 2026
Merged

Improve aggregation concurrent safe tests#8021
dashpole merged 8 commits intoopen-telemetry:mainfrom
dashpole:exphist_concurrentsafe_tests

Conversation

@dashpole
Copy link
Copy Markdown
Contributor

@dashpole dashpole commented Mar 8, 2026

I'm taking a stab at improving the ConcurrentSafe tests for aggregations before taking on the lockless exponential histogram implementation again.

Part of #7796

This PR includes a few improvements:

  • All concurrent-safe tests now use 10 different attribute sets to make sure we are testing concurrent increments that result in an overflow (the cardinality limit of the test is 3).
  • All concurrent-safe tests for floats now include decimal valued-inputs.
  • Improved the validation of the collected metrics:
    • Validate the total after multiple collects.
    • Validate that increments are made to the correct bucket for histograms
    • Validate that the overflow attribute set has the correct total value.

This uncovered an apparent race condition where the lastvalue aggregation can collect a value of zero even when no zero-value is recorded. I added a TODO, and will fix this in a follow-up.

I used AI to help me design and implement tests, but requested each of the changes, and reviewed the output.

@dashpole dashpole added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Mar 8, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.6%. Comparing base (2ffde5a) to head (be30249).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8021   +/-   ##
=====================================
  Coverage   81.6%   81.6%           
=====================================
  Files        304     304           
  Lines      23452   23452           
=====================================
  Hits       19141   19141           
- Misses      3928    3929    +1     
+ Partials     383     382    -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.

@dashpole dashpole closed this Mar 8, 2026
@dashpole dashpole force-pushed the exphist_concurrentsafe_tests branch from 9e8e22c to 8b05173 Compare March 8, 2026 19:19
@dashpole dashpole reopened this Mar 8, 2026
@dashpole dashpole force-pushed the exphist_concurrentsafe_tests branch from 062dc8b to d9a18a0 Compare March 8, 2026 20:10
@dashpole dashpole marked this pull request as ready for review March 8, 2026 21:29
dashpole and others added 4 commits March 12, 2026 16:16
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@dashpole dashpole merged commit 65f85fc into open-telemetry:main Mar 13, 2026
32 checks passed
@dashpole dashpole deleted the exphist_concurrentsafe_tests branch March 13, 2026 12:36
dashpole added a commit that referenced this pull request Mar 16, 2026
This initializes the value of the gauge with the correct value before it
is stored in the map. We end up storing the same thing twice on the
first call, but that isn't a big deal performance-wise.

Discovered during
#8021
@pellared pellared added this to the v1.43.0 milestone Apr 1, 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