Fix flaky vert.x sql concurrency test (#10924)

This commit is contained in:
Lauri Tulmin 2024-03-22 17:07:52 +02:00 committed by GitHub
parent c8a1f8318d
commit 275188a9e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 15 deletions

View File

@ -373,23 +373,22 @@ class VertxSqlClientTest {
for (CompletableFuture<Object> future : futureList) {
executorService.submit(
() -> {
testing
.runWithSpan(
"parent",
() ->
pool.withConnection(
testing.runWithSpan(
"parent",
() ->
pool.withConnection(
conn ->
conn.preparedQuery("select * from test where id = $1")
.execute(Tuple.of(1))))
.onComplete(
rowSetAsyncResult -> {
if (rowSetAsyncResult.succeeded()) {
future.complete(rowSetAsyncResult.result());
} else {
future.completeExceptionally(rowSetAsyncResult.cause());
}
latch.countDown();
});
.execute(Tuple.of(1)))
.onComplete(
rowSetAsyncResult -> {
if (rowSetAsyncResult.succeeded()) {
future.complete(rowSetAsyncResult.result());
} else {
future.completeExceptionally(rowSetAsyncResult.cause());
}
latch.countDown();
}));
});
}
latch.await(30, TimeUnit.SECONDS);