From f0178c4742069a6d2b9c400f0fbfcc678ab07b11 Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Wed, 8 Jan 2025 17:54:44 +0100 Subject: [PATCH 1/2] Revert "Disable OracleConnectionTest#testConnectNoLeak tests (#1482)" This reverts commit c30df2fbe14e47ac502c95e1315fd8ea57b3cb66. --- .../test/tck/OracleConnectionTest.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleConnectionTest.java b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleConnectionTest.java index 551498498..7ce9a5da7 100644 --- a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleConnectionTest.java +++ b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleConnectionTest.java @@ -16,8 +16,6 @@ import io.vertx.sqlclient.spi.DatabaseMetadata; import io.vertx.sqlclient.tck.ConnectionTestBase; import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; import org.junit.runner.RunWith; @RunWith(VertxUnitRunner.class) @@ -43,24 +41,4 @@ protected void validateDatabaseMetaData(TestContext ctx, DatabaseMetadata md) { ctx.assertTrue(md.fullVersion().contains("Oracle")); ctx.assertTrue(md.productName().contains("Oracle")); } - - @Test - @Ignore - @Override - public void testConnectNoLeak(TestContext ctx) throws Exception { - // Disabled for Oracle because we frequently get ORA-12516 Cannot connect to database - // https://docs.oracle.com/en/error-help/db/ora-12516/?r=23ai - // Probable cause is that the service handler gets in a blocked state and is not accepting new connections - super.testConnectNoLeak(ctx); - } - - @Test - @Ignore - @Override - public void testConnectNoLeakInVerticle(TestContext ctx) throws Exception { - // Disabled for Oracle because we frequently get ORA-12516 Cannot connect to database - // https://docs.oracle.com/en/error-help/db/ora-12516/?r=23ai - // Probable cause is that the service handler gets in a blocked state and is not accepting new connections - super.testConnectNoLeakInVerticle(ctx); - } } From 6fa3ed3989c3cb9c29111ee127694d33824d9eff Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Wed, 8 Jan 2025 18:02:55 +0100 Subject: [PATCH 2/2] 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 --- .../java/io/vertx/sqlclient/tck/ConnectionTestBase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vertx-sql-client/src/test/java/io/vertx/sqlclient/tck/ConnectionTestBase.java b/vertx-sql-client/src/test/java/io/vertx/sqlclient/tck/ConnectionTestBase.java index 21ce0d8f8..2fe7c5248 100644 --- a/vertx-sql-client/src/test/java/io/vertx/sqlclient/tck/ConnectionTestBase.java +++ b/vertx-sql-client/src/test/java/io/vertx/sqlclient/tck/ConnectionTestBase.java @@ -58,8 +58,8 @@ public void testConnect(TestContext ctx) { public void testConnectNoLeak(TestContext ctx) throws Exception { Set> connections = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>())); Set factories = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>())); - Async async = ctx.async(100); - for (int i = 0; i < 100; i++) { + Async async = ctx.async(10); + for (int i = 0; i < 10; i++) { connect(ctx.asyncAssertSuccess(conn -> { SqlConnectionBase base = (SqlConnectionBase) conn; connections.add(base); @@ -80,11 +80,11 @@ public void testConnectNoLeak(TestContext ctx) throws Exception { public void testConnectNoLeakInVerticle(TestContext ctx) throws Exception { Set> connections = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>())); Set factories = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>())); - Async async = ctx.async(100); + Async async = ctx.async(10); vertx.deployVerticle(new AbstractVerticle() { @Override public void start() throws Exception { - for (int i = 0; i < 100; i++) { + for (int i = 0; i < 10; i++) { connect(ctx.asyncAssertSuccess(conn -> { SqlConnectionBase base = (SqlConnectionBase) conn; connections.add(base);