Skip to content

Commit 6fa3ed3

Browse files
committed
Reduce number of connections made in testConnectNoLeak tests
We only need a few of them to verify whether there is a leak. And we avoid putting to much pressure on the Oracle test DB. Signed-off-by: Thomas Segismont <[email protected]>
1 parent f0178c4 commit 6fa3ed3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vertx-sql-client/src/test/java/io/vertx/sqlclient/tck/ConnectionTestBase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public void testConnect(TestContext ctx) {
5858
public void testConnectNoLeak(TestContext ctx) throws Exception {
5959
Set<SqlConnectionBase<?>> connections = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
6060
Set<ConnectionFactory> factories = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
61-
Async async = ctx.async(100);
62-
for (int i = 0; i < 100; i++) {
61+
Async async = ctx.async(10);
62+
for (int i = 0; i < 10; i++) {
6363
connect(ctx.asyncAssertSuccess(conn -> {
6464
SqlConnectionBase<?> base = (SqlConnectionBase<?>) conn;
6565
connections.add(base);
@@ -80,11 +80,11 @@ public void testConnectNoLeak(TestContext ctx) throws Exception {
8080
public void testConnectNoLeakInVerticle(TestContext ctx) throws Exception {
8181
Set<SqlConnectionBase<?>> connections = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
8282
Set<ConnectionFactory> factories = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
83-
Async async = ctx.async(100);
83+
Async async = ctx.async(10);
8484
vertx.deployVerticle(new AbstractVerticle() {
8585
@Override
8686
public void start() throws Exception {
87-
for (int i = 0; i < 100; i++) {
87+
for (int i = 0; i < 10; i++) {
8888
connect(ctx.asyncAssertSuccess(conn -> {
8989
SqlConnectionBase<?> base = (SqlConnectionBase<?>) conn;
9090
connections.add(base);

0 commit comments

Comments
 (0)