Reduce flakiness in io.opentelemetry.javaagent.instrumentation.vertx.rx.v3_5.server.VertxReactivePropagationTest.highConcurrency()#18508
Closed
trask wants to merge 1 commit into
Closed
Reduce flakiness in io.opentelemetry.javaagent.instrumentation.vertx.rx.v3_5.server.VertxReactivePropagationTest.highConcurrency()#18508trask wants to merge 1 commit into
trask wants to merge 1 commit into
Conversation
…rx.v3_5.server.VertxReactivePropagationTest.highConcurrency() Automated fix attempt based on Develocity flaky-test analysis.
f78b6e5 to
d44376e
Compare
Member
Author
|
Closing in favor of more conservative change: #18511 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated attempt at fixing flakiness in
io.opentelemetry.javaagent.instrumentation.vertx.rx.v3_5.server.VertxReactivePropagationTest.highConcurrency().instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/java/io/opentelemetry/javaagent/instrumentation/vertx/rx/v3_5/server/VertxReactivePropagationTest.javaRecent failed/flaky scans
:instrumentation:vertx:vertx-rx-java-3.5:javaagent:version5TestStableSemconv)Flake history (per UTC day)
Sample failure (from Develocity)
Copilot diagnosis
Root cause
The failing traces contained six spans instead of the expected five because two high-concurrency client requests were occasionally associated with the same trace. The test reused executor threads and started each synthetic
client Nspan from the ambientContext.current(), so any context left current on a reused worker could make the next request inherit the previous trace. The submitted task futures were also ignored, so latch interruptions or request failures could be hidden until span assertions timed out or observed partially unexpected telemetry.Fix
Context.root()before creating theclient Nspan.CountDownLatch.await(...).Why this addresses the root cause
Forcing a root context isolates each concurrent request from stale thread-local context on reused executor threads, so each request owns exactly one client root span and one propagated server trace. Waiting on the futures makes task-level failures deterministic and ensures trace assertions run only after all 100 requests have completed.
Risks / follow-ups
Review the diagnosis and the diff carefully before merging - automated fixes can mask flakiness instead of addressing the root cause.