Details
Description
HBaseTestingUtility#waitUntilAllRegionsAssigned(final TableName tableName) hard coded 60 seconds wait for region assignment in a table. This could cause flaky tests, as the caller could create table with longs of region which takes longs time; or in CM, RS unavailable could slow down assignment; or in a slow machine, IT might take long to assign regions.
In HBaseAdmin.java, we use a configurable value to wait for the table DDLs: this.syncWaitTimeout = this.conf.getInt("hbase.client.sync.wait.timeout.msec", 10 * 60000); // 10min - we should use the config for the HBaseTestingUtility#waitUntilAllRegionsAssigned() too.
Of course, the caller could use the "public void waitUntilAllRegionsAssigned(final TableName tableName, final long timeout)"; but it requires test change (currently, no test directly calls this signature).
/** * Wait until all regions for a table in hbase:meta have a non-empty * info:server, up to 60 seconds. This means all regions have been deployed, * master has been informed and updated hbase:meta with the regions deployed * server. * @param tableName the table name * @throws IOException */ public void waitUntilAllRegionsAssigned(final TableName tableName) throws IOException { waitUntilAllRegionsAssigned(tableName, 60000); }