Skip to content

Commit 94b4ae1

Browse files
authored
Re enable no leak oracle tests (#1484)
* Revert "Disable OracleConnectionTest#testConnectNoLeak tests (#1482)" This reverts commit c30df2f. * 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 <tsegismont@gmail.com> --------- Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 25d9056 commit 94b4ae1

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleConnectionTest.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import io.vertx.sqlclient.spi.DatabaseMetadata;
1717
import io.vertx.sqlclient.tck.ConnectionTestBase;
1818
import org.junit.ClassRule;
19-
import org.junit.Ignore;
20-
import org.junit.Test;
2119
import org.junit.runner.RunWith;
2220

2321
@RunWith(VertxUnitRunner.class)
@@ -43,24 +41,4 @@ protected void validateDatabaseMetaData(TestContext ctx, DatabaseMetadata md) {
4341
ctx.assertTrue(md.fullVersion().contains("Oracle"));
4442
ctx.assertTrue(md.productName().contains("Oracle"));
4543
}
46-
47-
@Test
48-
@Ignore
49-
@Override
50-
public void testConnectNoLeak(TestContext ctx) throws Exception {
51-
// Disabled for Oracle because we frequently get ORA-12516 Cannot connect to database
52-
// https://docs.oracle.com/en/error-help/db/ora-12516/?r=23ai
53-
// Probable cause is that the service handler gets in a blocked state and is not accepting new connections
54-
super.testConnectNoLeak(ctx);
55-
}
56-
57-
@Test
58-
@Ignore
59-
@Override
60-
public void testConnectNoLeakInVerticle(TestContext ctx) throws Exception {
61-
// Disabled for Oracle because we frequently get ORA-12516 Cannot connect to database
62-
// https://docs.oracle.com/en/error-help/db/ora-12516/?r=23ai
63-
// Probable cause is that the service handler gets in a blocked state and is not accepting new connections
64-
super.testConnectNoLeakInVerticle(ctx);
65-
}
6644
}

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)