This is an automated email from the ASF dual-hosted git repository. virajjasani pushed a commit to branch 5.3 in repository https://gitbox.apache.org/repos/asf/phoenix.git
commit 1ce910896db0998bfdb57803d334099528be81fd Author: Andrew Purtell <[email protected]> AuthorDate: Tue Jun 30 15:55:29 2026 -0700 PHOENIX-7831 PhoenixQueryTimeoutIT wait for DelayedRegionObserver to load (#2448) --- .../apache/phoenix/iterate/PhoenixQueryTimeoutIT.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java b/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java index ffd0bbaf25..98724c8dc6 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java @@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.client.Scan; 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; @@ -191,6 +192,22 @@ public class PhoenixQueryTimeoutIT extends ParallelStatsDisabledIT { 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);
