@Test
public void testCloseEntityGroupThatFetchesTheEGIFromMeta() throws Exception {
byte[] TABLENAME = Bytes.toBytes("TestWASPCloseEntityGroup2");
createTableWithDefaultConf(TABLENAME);
EntityGroup eg = null;
FServer fs = TEST_UTIL.getFSForFirstEntityGroupInTable(TABLENAME);
for (EntityGroup entityGroup : fs.getOnlineEntityGroups()) {
if (entityGroup.getEntityGroupNameAsString().contains(
"TestWASPCloseEntityGroup2")) {
eg = entityGroup;
admin.closeEntityGroup(entityGroup.getEntityGroupNameAsString(), fs
.getServerName().getServerName());
}
}
boolean isInList = fs.getOnlineEntityGroups().contains(eg);
long timeout = System.currentTimeMillis() + 2000;
while ((System.currentTimeMillis() < timeout) && (isInList)) {
Thread.sleep(100);
isInList = fs.getOnlineEntityGroups().contains(eg);
}
assertFalse(
"The EntityGroup should not be present in online EntityGroups list.",
isInList);
}