Skip to content

First pass at flaky VertxReactivePropagationTest.highConcurrency#18511

Closed
trask wants to merge 4 commits into
open-telemetry:mainfrom
trask:alt
Closed

First pass at flaky VertxReactivePropagationTest.highConcurrency#18511
trask wants to merge 4 commits into
open-telemetry:mainfrom
trask:alt

Conversation

@trask

@trask trask commented May 2, 2026

Copy link
Copy Markdown
Member

Extracted from #18508

I removed the manual context propagation because worried that might be hiding something.

But the other changes look good and could help narrow down future flaky diagnosis of this test.

@trask trask changed the title First pass at flaky test First pass at flaky VertxReactivePropagationTest.highConcurrency May 2, 2026
# Conflicts:
#	instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/java/io/opentelemetry/javaagent/instrumentation/vertx/rx/v3_5/server/VertxReactivePropagationTest.java
#	instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version41Test/java/io/opentelemetry/javaagent/instrumentation/vertx/rx/v3_5/server/VertxReactivePropagationTest.java
#	instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version5Test/java/io/opentelemetry/javaagent/instrumentation/vertx/rx/v3_5/server/VertxReactivePropagationTest.java
@trask trask marked this pull request as ready for review May 3, 2026 05:16
@trask trask requested a review from a team as a code owner May 3, 2026 05:16
This was referenced May 3, 2026
@trask trask requested a review from Copilot May 9, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Vert.x RxJava 3.5 VertxReactivePropagationTest.highConcurrency test variants to make failures more deterministic and easier to debug by adding bounded waits and ensuring all submitted request tasks complete before trace assertions run.

Changes:

  • Add a timeout/assertion around the start latch to avoid silent hangs.
  • Track Futures from submitted tasks and wait for completion before asserting traces.
  • Update the test method signature to allow propagation of checked exceptions from task completion waits.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/java/io/opentelemetry/javaagent/instrumentation/vertx/rx/v3_5/server/VertxReactivePropagationTest.java Add latch timeout assertion and wait for all task futures before validating traces.
instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version41Test/java/io/opentelemetry/javaagent/instrumentation/vertx/rx/v3_5/server/VertxReactivePropagationTest.java Same concurrency test hardening (timeouts + Future waiting) for the 4.1 test variant.
instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version5Test/java/io/opentelemetry/javaagent/instrumentation/vertx/rx/v3_5/server/VertxReactivePropagationTest.java Same concurrency test hardening (timeouts + Future waiting) for the 5.x test variant.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@@ -160,29 +163,36 @@ void highConcurrency() {
TextMapSetter<HttpRequestBuilder> setter =
(carrier, name, value) -> carrier.header(name, value);

List<Future<?>> futures = new ArrayList<>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this won't do anything to fix the flaky test. If you believe that waiting for all the submitted tasks helps I'd suggest to also change the highConcurrency method in AbstractHttpClientTest that these methods copy from.
I get why copilot is forcing recomputing the deadline, but it looks a bit too much effort. Maybe we could avoid it with the following

CompletableFuture<?>[] tasks = new CompletableFuture[count];
for (int i = 0; i < count; i++) {
  tasks[i] = CompletableFuture.runAsync(job, pool);
}
latch.countDown();
CompletableFuture.allOf(tasks).get(30, SECONDS);

@laurit

laurit commented May 22, 2026

Copy link
Copy Markdown
Contributor

@trask trask closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants