Skip to content

Reduce flakyness of testExemplarsClassicHistogram - #1842

Merged
zeitlinger merged 4 commits into
mainfrom
flaky-test
Feb 4, 2026
Merged

Reduce flakyness of testExemplarsClassicHistogram#1842
zeitlinger merged 4 commits into
mainfrom
flaky-test

Conversation

@jaydeluca

@jaydeluca jaydeluca commented Feb 2, 2026

Copy link
Copy Markdown
Member

I've been encountering issues with io.prometheus.metrics.core.metrics.HistogramTest.testExemplarsClassicHistogram when running tests locally, lot's of these:

[ERROR] Tests run: 28, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.279 s <<< FAILURE! -- in io.prometheus.metrics.core.metrics.HistogramTest
[ERROR] io.prometheus.metrics.core.metrics.HistogramTest.testExemplarsClassicHistogram -- Time elapsed: 0.055 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "io.prometheus.metrics.model.snapshots.Exemplar.getValue()" because "actual" is null
        at io.prometheus.metrics.core.metrics.TestUtil.assertExemplarEquals(TestUtil.java:13)
        at io.prometheus.metrics.core.metrics.HistogramTest.testExemplarsClassicHistogram(HistogramTest.java:1054)

attempting to make it a little more reliable with awaitility.

Alternatively we could refactor the ExemplarSampler to take a clock as an argument so we could mock it, but I figured we could start here before we change the production code

Signed-off-by: Jay DeLuca <jaydeluca4@gmail.com>

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jay DeLuca <jaydeluca4@gmail.com>
@jaydeluca
jaydeluca force-pushed the flaky-test branch 2 times, most recently from 3c85324 to 777df50 Compare February 2, 2026 17:09
Signed-off-by: Jay DeLuca <jaydeluca4@gmail.com>
@jaydeluca
jaydeluca marked this pull request as ready for review February 2, 2026 17:21
@jaydeluca
jaydeluca requested a review from zeitlinger February 2, 2026 17:21
Comment thread prometheus-metrics-core/pom.xml Outdated
Signed-off-by: Jay DeLuca <jaydeluca4@gmail.com>
@zeitlinger
zeitlinger merged commit baf8b76 into main Feb 4, 2026
43 checks passed
@zeitlinger
zeitlinger deleted the flaky-test branch February 4, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants