Tempo: Fix flaky test (#74169)

This commit is contained in:
Fabrizio 2023-09-06 18:08:24 +02:00 committed by GitHub
parent f52936a604
commit 3ccfa5620f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,14 +140,16 @@ function attachReferences(spans: TraceSpanData[], depth: number, spansPerLevel:
export default chance.mixin({ export default chance.mixin({
trace({ trace({
// long trace numberOfSpans = Math.max(
// very short trace Math.ceil(
// average case chance.pickone([
numberOfSpans = chance.pickone([ chance.normal({ mean: 200, dev: 10 }), // long trace
Math.ceil(chance.normal({ mean: 200, dev: 10 })) + 1, chance.integer({ min: 3, max: 10 }), // very short trace
Math.ceil(chance.integer({ min: 3, max: 10 })), chance.normal({ mean: 45, dev: 15 }), // average case
Math.ceil(chance.normal({ mean: 45, dev: 15 })) + 1, ])
]), ),
1 // `pickone` might pick a negative number (or zero) from one of the normal distributions, but we need to have at least one span
),
numberOfProcesses = chance.integer({ min: 1, max: 10 }), numberOfProcesses = chance.integer({ min: 1, max: 10 }),
maxDepth = chance.integer({ min: 1, max: 10 }), maxDepth = chance.integer({ min: 1, max: 10 }),
spansPerLevel = null, spansPerLevel = null,