Skip to content

Commit 275188a

Browse files
authored
Fix flaky vert.x sql concurrency test (#10924)
1 parent c8a1f83 commit 275188a

File tree

1 file changed

+14
-15
lines changed
  • instrumentation/vertx/vertx-sql-client-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql

1 file changed

+14
-15
lines changed

instrumentation/vertx/vertx-sql-client-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql/VertxSqlClientTest.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -373,23 +373,22 @@ void testConcurrency() throws Exception {
373373
for (CompletableFuture<Object> future : futureList) {
374374
executorService.submit(
375375
() -> {
376-
testing
377-
.runWithSpan(
378-
"parent",
379-
() ->
380-
pool.withConnection(
376+
testing.runWithSpan(
377+
"parent",
378+
() ->
379+
pool.withConnection(
381380
conn ->
382381
conn.preparedQuery("select * from test where id = $1")
383-
.execute(Tuple.of(1))))
384-
.onComplete(
385-
rowSetAsyncResult -> {
386-
if (rowSetAsyncResult.succeeded()) {
387-
future.complete(rowSetAsyncResult.result());
388-
} else {
389-
future.completeExceptionally(rowSetAsyncResult.cause());
390-
}
391-
latch.countDown();
392-
});
382+
.execute(Tuple.of(1)))
383+
.onComplete(
384+
rowSetAsyncResult -> {
385+
if (rowSetAsyncResult.succeeded()) {
386+
future.complete(rowSetAsyncResult.result());
387+
} else {
388+
future.completeExceptionally(rowSetAsyncResult.cause());
389+
}
390+
latch.countDown();
391+
}));
393392
});
394393
}
395394
latch.await(30, TimeUnit.SECONDS);

0 commit comments

Comments
 (0)