// Make sure the number of connections doesn't go below minSize ConnectionPool pool3 = new ConnectionPool( conf, TEST_NN_ADDRESS, TEST_USER3, 2, 10); addConnectionsToPool(pool3, 10, 0); poolMap.put(new ConnectionPoolId(TEST_USER2, TEST_NN_ADDRESS), pool3); connManager.cleanup(pool3); checkPoolConnections(TEST_USER3, 2, 0);
this part need correction
Here new ConnectionPoolId is created with TEST_USER2 but checkPoolConnections is done using TEST_USER3.
In checkPoolConnections method
if (e.getKey().getUgi() == ugi)
then only it will validate numOfConns and numOfActiveConns. In this case for TEST_USER3 ' if 'condition is returning false and if you pass any value to the checkPoolConnections method, the test case will pass.
- is related to
HDFS-13232 RBF: ConnectionPool should return first usable connection