From c22181e79fadd9e2e2ff587c4a4deca85408d72f Mon Sep 17 00:00:00 2001 From: Nathan Gough Date: Wed, 19 Oct 2022 13:03:15 -0400 Subject: [PATCH] NIFI-10672 - Removed intermittently failing method from DBCPServiceTest This closes #6555 Signed-off-by: David Handermann --- .../org/apache/nifi/dbcp/DBCPServiceTest.java | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java index dd7ca6bbaa..4074567dc6 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java @@ -40,7 +40,6 @@ import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.util.ArrayList; import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -249,58 +248,6 @@ public class DBCPServiceTest { service.getDataSource().close(); } - @Test - public void testGetDataSourceIdleProperties() throws SQLException { - runner.setProperty(service, DBCPConnectionPool.MAX_WAIT_TIME, "${max.wait.time}"); - runner.setProperty(service, DBCPConnectionPool.MAX_TOTAL_CONNECTIONS, "${max.total.connections}"); - runner.setProperty(service, DBCPConnectionPool.MAX_IDLE, "${max.idle}"); - runner.setProperty(service, DBCPConnectionPool.MIN_IDLE, "${min.idle}"); - runner.setProperty(service, DBCPConnectionPool.MAX_CONN_LIFETIME, "${max.conn.lifetime}"); - runner.setProperty(service, DBCPConnectionPool.EVICTION_RUN_PERIOD, "${eviction.run.period}"); - runner.setProperty(service, DBCPConnectionPool.MIN_EVICTABLE_IDLE_TIME, "${min.evictable.idle.time}"); - runner.setProperty(service, DBCPConnectionPool.SOFT_MIN_EVICTABLE_IDLE_TIME, "${soft.min.evictable.idle.time}"); - - runner.setVariable("max.wait.time", "1 sec"); - runner.setVariable("max.total.connections", "7"); - runner.setVariable("max.idle", "4"); - runner.setVariable("min.idle", "1"); - runner.setVariable("max.conn.lifetime", "1000 millis"); - runner.setVariable("eviction.run.period", "100 millis"); - runner.setVariable("min.evictable.idle.time", "100 millis"); - runner.setVariable("soft.min.evictable.idle.time", "100 millis"); - - runner.enableControllerService(service); - - ArrayList connections = new ArrayList<>(); - for (int i = 0; i < 6; i++) { - connections.add(service.getConnection()); - } - - assertEquals(6, service.getDataSource().getNumActive()); - - connections.get(0).close(); - assertEquals(5, service.getDataSource().getNumActive()); - assertEquals(1, service.getDataSource().getNumIdle()); - - connections.get(1).close(); - connections.get(2).close(); - connections.get(3).close(); - //now at max idle - assertEquals(2, service.getDataSource().getNumActive()); - assertEquals(4, service.getDataSource().getNumIdle()); - - //now a connection should get closed for real so that numIdle does not exceed maxIdle - connections.get(4).close(); - assertEquals(4, service.getDataSource().getNumIdle()); - assertEquals(1, service.getDataSource().getNumActive()); - - connections.get(5).close(); - assertEquals(4, service.getDataSource().getNumIdle()); - assertEquals(0, service.getDataSource().getNumActive()); - - service.getDataSource().close(); - } - private void assertConnectionNotNullDynamicProperty(final String propertyName, final String propertyValue) throws SQLException { runner.setProperty(service, propertyName, propertyValue);