Skip to content

Commit 021f84a

Browse files
authored
PgPoolTest.testEventLoopSize fails on systems with more than 25 cores (#1572)
See #1569 This happens because the default Postgres config allows for 100 connections at most. Signed-off-by: Thomas Segismont <[email protected]>
1 parent cee8982 commit 021f84a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgPoolTest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
import io.netty.channel.EventLoop;
2121
import io.vertx.core.Handler;
2222
import io.vertx.core.VertxOptions;
23+
import io.vertx.core.internal.ContextInternal;
2324
import io.vertx.ext.unit.Async;
2425
import io.vertx.ext.unit.TestContext;
2526
import io.vertx.ext.unit.junit.Repeat;
2627
import io.vertx.ext.unit.junit.RepeatRule;
27-
import io.vertx.core.internal.ContextInternal;
2828
import io.vertx.pgclient.PgBuilder;
2929
import io.vertx.pgclient.PgConnectOptions;
3030
import io.vertx.pgclient.PgConnection;
@@ -35,11 +35,7 @@
3535
import org.junit.Rule;
3636
import org.junit.Test;
3737

38-
import java.util.ArrayList;
39-
import java.util.Collections;
40-
import java.util.HashSet;
41-
import java.util.List;
42-
import java.util.Set;
38+
import java.util.*;
4339
import java.util.concurrent.TimeUnit;
4440
import java.util.concurrent.atomic.AtomicInteger;
4541
import java.util.concurrent.atomic.AtomicLong;
@@ -281,7 +277,7 @@ public void testUseAvailableResources(TestContext ctx) {
281277

282278
@Test
283279
public void testEventLoopSize(TestContext ctx) {
284-
int num = VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE;
280+
int num = Math.min(VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE, 50);
285281
int size = num * 2;
286282
Pool pool = PgBuilder.pool(b -> b.with(new PoolOptions().setMaxSize(size).setEventLoopSize(2)).connectingTo(options));
287283
Set<EventLoop> eventLoops = Collections.synchronizedSet(new HashSet<>());

0 commit comments

Comments
 (0)