Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.phoenix.coprocessorclient.BaseScannerRegionObserverConstants;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
Expand Down Expand Up @@ -191,6 +192,22 @@ public void testScanningResultIteratorQueryTimeoutForPagingWithVeryLowTimeout()
DelayedRegionObserver.setDelay(5);
// Add delay on the server so that the query times out
TestUtil.addCoprocessor(conn, tableName, DelayedRegionObserver.class);
// modifyTable updates the master descriptor but region servers reopen
// asynchronously. Poll until the coprocessor is actually loaded.
final TableName tn = TableName.valueOf(tableName);
getUtility().waitFor(10000, 100, () -> {
List<HRegion> regions = getUtility().getHBaseCluster().getRegions(tn);
if (regions.isEmpty()) {
return false;
}
for (HRegion region : regions) {
if (region.getCoprocessorHost().findCoprocessor(
DelayedRegionObserver.class.getName()) == null) {
return false;
}
}
return true;
});
// Do not let BaseResultIterators throw Timeout Exception Let ScanningResultIterator handle
// it.
BaseResultIterators.setForTestingSetTimeoutToMaxToLetQueryPassHere(true);
Expand Down