#7461 Use less strict assertion for expiring pool to account for potential expirations
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
parent
d42664ee1e
commit
4382bc122e
|
@ -54,6 +54,8 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
|
import static org.hamcrest.Matchers.is;
|
||||||
|
import static org.hamcrest.Matchers.lessThanOrEqualTo;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
@ -316,7 +318,10 @@ public class ConnectionPoolTest
|
||||||
assertEquals(1, destinations.size());
|
assertEquals(1, destinations.size());
|
||||||
HttpDestination destination = (HttpDestination)destinations.get(0);
|
HttpDestination destination = (HttpDestination)destinations.get(0);
|
||||||
AbstractConnectionPool connectionPool = (AbstractConnectionPool)destination.getConnectionPool();
|
AbstractConnectionPool connectionPool = (AbstractConnectionPool)destination.getConnectionPool();
|
||||||
assertEquals(2, connectionPool.getConnectionCount());
|
if (DUPLEX_MAX_DURATION == factory)
|
||||||
|
assertThat(connectionPool.getConnectionCount(), lessThanOrEqualTo(2)); // The connections can expire upon release.
|
||||||
|
else
|
||||||
|
assertThat(connectionPool.getConnectionCount(), is(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
|
|
Loading…
Reference in New Issue