PHOENIX-4993 (addendum) Fix test timeout issue
authorKiran Kumar Maturi <maturi.kiran@gmail.com>
Fri, 1 Feb 2019 08:35:03 +0000 (14:05 +0530)
committerVincent Poon <vincentpoon@apache.org>
Fri, 1 Feb 2019 19:14:58 +0000 (11:14 -0800)
phoenix-core/src/test/java/org/apache/phoenix/util/CoprocessorHConnectionTableFactoryTest.java

index 3997fca..bf25682 100644 (file)
@@ -98,10 +98,12 @@ public class CoprocessorHConnectionTableFactoryTest extends BaseUniqueNamesOwnCl
     conn.createStatement().execute("CREATE INDEX " + index1Name + " ON " + tableName + "(v1)");
     List<HRegionInfo> regions = admin.getTableRegions(TableName.valueOf(tableName));
     final HRegionInfo regionInfo = regions.get(0);
+
     writeToTable(tableName, conn, noOfOrgs);
     int beforeRegionCloseCount = getActiveConnections(regionServer, conf);
+    int regionsCount = admin.getOnlineRegions(regionServer.getServerName()).size();
     admin.unassign(regionInfo.getEncodedNameAsBytes(), true);
-    getUtility().waitUntilAllRegionsAssigned(TableName.valueOf(tableName));
+    while(!(admin.getOnlineRegions(regionServer.getServerName()).size() < regionsCount));
     int afterRegionCloseCount = getActiveConnections(regionServer, conf);
     assertTrue("Cached connections not closed when region closes: ",
     afterRegionCloseCount == beforeRegionCloseCount && afterRegionCloseCount > 0);