From 7cd1e37c255f2465a7b8e1ea96143c2ef8c698ca Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Thu, 13 Nov 2025 15:29:25 +0100 Subject: [PATCH] PgPoolTest.testEventLoopSize fails on systems with more than 25 cores See #1569 This happens because the default Postgres config allows for 100 connections at most. Signed-off-by: Thomas Segismont --- .../test/java/io/vertx/tests/pgclient/PgPoolTest.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgPoolTest.java b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgPoolTest.java index 3cb1c56f0..d32377f39 100644 --- a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgPoolTest.java +++ b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgPoolTest.java @@ -20,11 +20,11 @@ import io.netty.channel.EventLoop; import io.vertx.core.Handler; import io.vertx.core.VertxOptions; +import io.vertx.core.internal.ContextInternal; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.Repeat; import io.vertx.ext.unit.junit.RepeatRule; -import io.vertx.core.internal.ContextInternal; import io.vertx.pgclient.PgBuilder; import io.vertx.pgclient.PgConnectOptions; import io.vertx.pgclient.PgConnection; @@ -35,11 +35,7 @@ import org.junit.Rule; import org.junit.Test; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; @@ -281,7 +277,7 @@ public void testUseAvailableResources(TestContext ctx) { @Test public void testEventLoopSize(TestContext ctx) { - int num = VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE; + int num = Math.min(VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE, 50); int size = num * 2; Pool pool = PgBuilder.pool(b -> b.with(new PoolOptions().setMaxSize(size).setEventLoopSize(2)).connectingTo(options)); Set eventLoops = Collections.synchronizedSet(new HashSet<>());