opentelemetry-java-contrib icon indicating copy to clipboard operation
opentelemetry-java-contrib copied to clipboard

Consistent sampling tests are flaky

Open laurit opened this issue 5 months ago • 0 comments

Component(s)

consistent-sampling

What happened?

https://scans.gradle.com/s/lkud6oenfjrhi https://scans.gradle.com/s/2xvjyd25fvjng Seems to be fairly easy to reproduce, change @Test to @RepeatedTest(100). added

    System.err.println(originalNumberOfSpans + " " + observedPvalues + " " + samplingProbability);
    System.err.println(expectedProbabilities + " " + Arrays.toString(observedValues));

to https://github.com/open-telemetry/opentelemetry-java-contrib/blob/d18102b7ba05be4ade560b9c3cd8ebb736220f1c/consistent-sampling/src/test/java/io/opentelemetry/contrib/sampler/consistent/ConsistentProbabilityBasedSamplerTest.java#L143 for failing test it printed out

1000000 {4=37074, 5=12751} 0.05
{4=0.037500000000000006, 5=0.012499999999999997, NOT SAMPLED=0.95} [37074, 12751, 950175]

Component version

1.48.0

Log output

No response

Additional context

No response

laurit avatar Jul 23 '25 10:07 laurit