HBASE-13192. IntegrationTestBulkLoad doesn't wait for table modification sometimes leading to spurious test failures.
This commit is contained in:
parent
f8dced1e6d
commit
e864dd0520
@ -1732,7 +1732,8 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
|
||||
setFirst(0);
|
||||
setSecond(0);
|
||||
}};
|
||||
for (int i = 0; status.getFirst() != 0 && i < 500; i++) { // wait up to 500 seconds
|
||||
int i = 0;
|
||||
do {
|
||||
status = admin.getAlterStatus(desc.getTableName());
|
||||
if (status.getSecond() != 0) {
|
||||
LOG.debug(status.getSecond() - status.getFirst() + "/" + status.getSecond()
|
||||
@ -1742,9 +1743,9 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
|
||||
LOG.debug("All regions updated.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (status.getSecond() != 0) {
|
||||
throw new IOException("Failed to update replica count after 500 seconds.");
|
||||
} while (status.getFirst() != 0 && i++ < 500);
|
||||
if (status.getFirst() != 0) {
|
||||
throw new IOException("Failed to update all regions even after 500 seconds.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1756,7 +1757,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
|
||||
admin.disableTable(table);
|
||||
HTableDescriptor desc = admin.getTableDescriptor(table);
|
||||
desc.setRegionReplication(replicaCount);
|
||||
modifyTableSync(admin, desc);
|
||||
admin.modifyTable(desc.getTableName(), desc);
|
||||
admin.enableTable(table);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user